[Logo] OLD FORUM - Use new one: https://www.CaptainCasa.online/forum
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Session Invalidated on very long processing  XML
Forum Index -> Development
Author Message
vadingding

Power User
[Avatar]

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
CaptainCasa

Power User
[Avatar]

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
vadingding

Power User
[Avatar]

Joined: 14/07/2017 13:26:37
Messages: 145
Offline

Thanks, now i know Life Saver!
vadingding

Power User
[Avatar]

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
CaptainCasa

Power User
[Avatar]

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
[Thumb - 2018-06-04 19_47_51-Sessions Administration for _demos.png]
 Filename 2018-06-04 19_47_51-Sessions Administration for _demos.png [Disk] Download
 Description
 Filesize 30 Kbytes
 Downloaded:  381 time(s)


Björn Müller, CaptainCasa GmbH
vadingding

Power User
[Avatar]

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
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team