Forums Register Login

Session Timeout handeling

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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 ]
+Pie Number of slices to send: Send
 

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.
What kind of corn soldier are you? And don't say "kernel" - that's only for this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1252 times.
Similar Threads
Setting Session Timeout
Session timeout
ConnectionTimeOut Vs sessionTimeout problem
IBM Http server
difference in actual and specified timeout
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 07:27:59.