Author |
Message |
04/06/2018 06:31:50
|
vadingding
Power User
Joined: 14/07/2017 13:26:37
Messages: 145
Offline
|
Hi Captain,
I'm not sure if this error is related to your framework, but I think you can give me some input . Seems like during a very long processing like 30mins, it invalidates my session automatically.
I am using mysql db..
Help would be much appreciated, Thanks!
Regards, Vincent
|
|
|
04/06/2018 07:01:11
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5555
Offline
|
This is the normal J2EE-servlet session timeout, that you can configure in web.xml. (Also take a look into Developer's Guide.) The default is 60 minutes as far as I know...
There are two tactics:
1. define a long session timeout, e.g. 2 hours
or
2. define a short one (30 minutes) and same time embed a TIMER into the outest page that polls the server e.g. every 20 minutes, so that the session is contacted periodically
AND: please use the SESSIONCLOSER in the outest page of your application, so that the session typically is closed when the user closes the page.
Regards, Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
04/06/2018 07:07:05
|
vadingding
Power User
Joined: 14/07/2017 13:26:37
Messages: 145
Offline
|
Thanks, now i know Life Saver!
|
|
|
04/06/2018 09:47:17
|
vadingding
Power User
Joined: 14/07/2017 13:26:37
Messages: 145
Offline
|
Hi Captain,
I tried putting the timer on the outest page, and while heavy processing it does executes some output (system.out), but still my session is timedout on 30th minute.
Any thoughts ?
Regards, Vincent
|
|
|
04/06/2018 17:28:12
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5555
Offline
|
..."not possible!"... ;-)
I just checked - no problems.
Open up the Tomcat-Manager and you can observe the "inactive time" which is the relevant one for session timeout-ing. See attached screenshot.
Please note: web.xml in minutes...
Code:
<session-config>
<session-timeout>5</session-timeout>
...
</session-config>
and duration in TIMER in milliseconds.
Do NOT use TIMER-DURATIONTYPE "lastactivity", but either use no DURATIONTYPE "lastroundtrip" of DURATIONTYPE "" (no definition).
Regards, Björn
|
Filename |
2018-06-04 19_47_51-Sessions Administration for _demos.png |
Download
|
Description |
|
Filesize |
30 Kbytes
|
Downloaded: |
381 time(s) |
|
Björn Müller, CaptainCasa GmbH |
|
|
05/06/2018 03:37:12
|
vadingding
Power User
Joined: 14/07/2017 13:26:37
Messages: 145
Offline
|
I didn't use some long polling component, because I have some session variables that i need to get during the processing.. What happens, is the page freezes then even though I outputted some text on the server using the TIMER component, the session invalidated.
Thanks for the response Captain!
Regards, Vincent
|
|
|
|