• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Session Timeout handeling

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
Im working with jsp's n servlets in WSAD 5.0. In my application the server session timeout value has been set through the server administration console to 30 minutes. Now I need to display a warning message "Your session is about to expire" 2 minutes prior to session expires. So is there ne way throught which i can get the server session timeout value in the my application at run time.
Please help.

Thanks
Kaustubh
 
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why dont you create a httpsessionlistener class? It has two methods which you have to override...

sessioncreated(httpsessionevent) and sessiondestroyed(httpsessionevent). You can write your display message in sessiondestroyed method. So, just before the session is ended the sessiondestroyed is called and your message will be displayed.

If you want to display it exactly 2 minutes before the session expires. I am not sure about how you should go about it.
[ April 10, 2007: Message edited by: Atul Savant ]
 
Sheriff
Posts: 28368
99
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Atul Savant:
If you want to display it exactly 2 minutes before the session expires. I am not sure about how you should go about it.

Yes, that's the impossible part. Your server only responds to requests, so if the client never sends you any more requests then you can't do this notification. And if you think about it for a bit, the client may not even have a page of your web application displayed. They might be checking their e-mail, or they might have turned off their computer.

The usual way to keep track of the client's time before session expiry is via Javascript on the client. But that's a subject for a different forum.
 
She said she got a brazillian. I think owning people is wrong. That is how I learned ... tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic