SusiMail: Successfully extend session expiration (ticket #1253)

by renaming the cookie, so we don't have a common session ID
with the base context and get it expired there.
This commit is contained in:
zzz
2014-04-18 21:32:45 +00:00
parent 3930113f00
commit 43883a90d2
2 changed files with 21 additions and 7 deletions

View File

@ -15,6 +15,20 @@
<session-config>
<session-timeout>1440</session-timeout>
</session-config>
<!-- tomcat (untested) -->
<context-param>
<param-name>crossContext</param-name>
<param-value>false</param-value>
</context-param>
<!-- jetty
- This is required so the same session ID isn't shared with
- the base context. When shared, it's expired after 30 minutes
- in the base context which invalidates it in our context too.
-->
<context-param>
<param-name>org.eclipse.jetty.servlet.SessionCookie</param-name>
<param-value>SUSIMAILJSESSIONID</param-value>
</context-param>
<!--
Jetty 6 mulipart form handling

View File

@ -1280,13 +1280,13 @@ public class WebMail extends HttpServlet
int newState = sessionObject.state;
if (oldState != newState)
Debug.debug(Debug.DEBUG, "STATE CHANGE from " + oldState + " to " + newState);
if (oldState == STATE_AUTH && newState != STATE_AUTH) {
// this isn't working in web.xml, so try setting it here
int oldIdle = httpSession.getMaxInactiveInterval();
httpSession.setMaxInactiveInterval(60*60*24); // seconds
int newIdle = httpSession.getMaxInactiveInterval();
Debug.debug(Debug.DEBUG, "Changed idle from " + oldIdle + " to " + newIdle);
}
// Set in web.xml
//if (oldState == STATE_AUTH && newState != STATE_AUTH) {
// int oldIdle = httpSession.getMaxInactiveInterval();
// httpSession.setMaxInactiveInterval(60*60*24); // seconds
// int newIdle = httpSession.getMaxInactiveInterval();
// Debug.debug(Debug.DEBUG, "Changed idle from " + oldIdle + " to " + newIdle);
//}
if( sessionObject.state != STATE_AUTH )
processGenericButtons( sessionObject, request );