my name is Patrick and im new in Java script, im designing a website as part of my final year project,
i have a problem with the sessions, how can i clear the session when i don't log off but just use the browser back button,
so that when i want to go back to that page , it must take me to the login page.?
Help needed quickly.
I am assuming that you are using a J2EE Server to serve your web pages. You should always provide a Session time out in the web.xml. If a user tries to close a window, without properly logging off, then the container automatically kills the sessions which are past the session time out.
Also if you feel that you should be redirecting to the login page, if there is no session, then have a filter in the web.xml that checks for valid session and performs the redirect.
Joined: Nov 15, 2010
Hi Praneeth Yeri, is there any script that is there as an example i can refer to?
Joined: Oct 07, 2010
For mentioning the Session Time out in web.xml, You can do the following in the web.xml file.
<session-timeout>: The timeout for a session in minutes.