You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Martin Hajduch <ma...@assyst-intl.com> on 2003/11/17 13:37:11 UTC
[PATCH] StandardSession session timeout fix
hi,
i'm having this problem:
1. after x mins of inactivity, user session is invalidated
(PersistentManagerBase.processExpires)
2. StandardSession.expire does setValid(false) and expiring=true at the
beginning
3. then it calls StandardSession.removeAttribute ->
SessionMonitor.valueUnbound -> StandardSession.getCreationTime
4. StandardSession.getCreationTime throws exception because isValid==false
5. this 'kills' PersistentManagerBase thread
this is supposed to be a fix for the problem:
===================================================================
RCS file:
/home/cvspublic/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/session/StandardSession.java,v
retrieving revision 1.36
diff -w -b -c -r1.36 StandardSession.java
*** StandardSession.java 29 Apr 2003 21:57:58 -0000 1.36
--- StandardSession.java 17 Nov 2003 12:31:19 -0000
***************
*** 895,901 ****
*/
public long getCreationTime() {
! if (!isValid)
throw new IllegalStateException
(sm.getString("standardSession.getCreationTime.ise"));
--- 895,902 ----
*/
public long getCreationTime() {
! // Validate our current state
! if (!expiring && !isValid)
throw new IllegalStateException
(sm.getString("standardSession.getCreationTime.ise"));
***** CVS exited normally with code 1 *****
regards,
martin
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org