• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Session Timeout Timer Reset

 
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

I want to reset my session timeout time back to 20 minutes each time the user sends a new request, 'm using struts 2.0, i have defined session timeout in web.xml as 20 minutes, so whatever the user does, he is logged out after 20 minutes, i have also set maxInactiveInterval as 20 minutes in the session listener, still its not taking the last accessed time but taking the session creation time and application times out after 20 minutes. what to do ?? THANKS IN ADVANCE FOR HELP. !!

i am using Geronimo 2.0 server.
[ September 10, 2008: Message edited by: Robin John ]
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

still its not taking the last accessed time but taking the session creation time and application times out after 20 minutes.



The servlet container WILL reset the session life countdown every time there is a request to the application having that session ID.

Why do you think it is not working?

Bill
 
Robin John
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no it times out abrubtly after 20 minutes, no matter what happens to the application
 
Robin John
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this is my code in web.xml

<listener>
<listener-class>
com.web.helper.WirSessionListener
</listener-class>
</listener>

<session-config>
<session-timeout>20</session-timeout>
</session-config>
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If your servlet container is not reseting the last accessed time every time a request comes in then it is not implementing the servlet API correctly. Geronimo 2.0 claims to be "fully certified Java EE 5 application server runtime."

Since this is a function that practically every complex servlet application depends on working correctly, it seems reasonable to me that something else is going on to invalidate your sessions. If it really is Geronimo's fault, you have discovered a serious bug.

Bill
 
Robin John
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks bill for the replies..., can you please tell me what all are needed to be done for implementing session timeout under the below scenario, it would be really helpful.

Requirement: If the user is idle for more than or equal to 20 minutes log him out.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All you do (as William has said) is set the session-timeout. The servlet container will do the rest. If it is not I'd send your test case to the Geronimo people. But I would be surprised if it were Geronimo's fault - this is a fairly key requirement of Servlet containers.
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes ! My answer will be the same as Pauls's statement. - Manoj
 
Robin John
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yup guys thanks so much !! the problem is resolved actually i was creating new request each time i got it from the client

it was a silly mistake from my side. was doing a getSession(true);

in the code and was not passing the session from one application to another so the reset was happening in one application but the user was in the other with a different session.

silly me..
thanks for your support...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic