380866 maxIdleTime set to 0 after session migration

This commit is contained in:
Jan Bartel 2012-05-29 18:06:22 +02:00
parent 58dd9c3bf1
commit 97fffb4e6a
2 changed files with 4 additions and 1 deletions

View File

@ -77,6 +77,7 @@ public abstract class AbstractSession implements AbstractSessionManager.SessionI
_accessed=accessed;
_lastAccessed=accessed;
_requests=1;
_maxIdleMs=_manager._dftMaxIdleSecs>0?_manager._dftMaxIdleSecs*1000L:-1;
if (LOG.isDebugEnabled())
LOG.debug("new session "+_nodeId+" "+_clusterId);
}

View File

@ -111,11 +111,11 @@ public abstract class AbstractSessionMigrationTest
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
HttpSession session = request.getSession(false);
if (session == null) session = request.getSession(true);
String action = request.getParameter("action");
if ("set".equals(action))
{
if (session == null) session = request.getSession(true);
int value = Integer.parseInt(request.getParameter("value"));
session.setAttribute("value", value);
PrintWriter writer = response.getWriter();
@ -125,6 +125,8 @@ public abstract class AbstractSessionMigrationTest
else if ("get".equals(action))
{
int value = (Integer)session.getAttribute("value");
int x = ((AbstractSession)session).getMaxInactiveInterval();
assertTrue(x > 0);
PrintWriter writer = response.getWriter();
writer.println(value);
writer.flush();