skip to content »

Invalidating session in struts

invalidating session in struts-35

Seems that the session object relies on server for its GC.What happens when session.invalidate() is called: Both attributes and session object are destroyed immediately??? In fact it is the servlet container that creates the session object.

invalidating session in struts-70invalidating session in struts-22invalidating session in struts-29invalidating session in struts-3

I felt that there should be a way to do it from Java Script; unfortunately, Java Script doesn't seem to have an handler that you want.When specified time ( 1 minute) is passed, I check the session availabilty as below: if(Session(false) == null) // redirect to login page This code doesn't seem to work and user is allowed to continue with his session after timeout period.However, If I set some attribute (say user)in session object during session creation and check for null value of the attribute after one minute, I get null and do the following: if((String)Session(false)Attribute("user")== null) // redirect to login page This code works fine.Lets understand this with the help of an example: In the below example we have three jsp pages.Output: while opening display page, all the attributes are getting displayed on client (browser).Now my question is whether session object exists after timeout and therfore I don't get null in first case.

But when timeout is over, attributes set in session are removed automatically and I get null in second case.

I am using struts and tomcat and wants the user to be redirected to login page after session timeout.

For testing purpose, I set 1 minute session timeout in both tomact and application files.

The problem is you want a page to be 'loaded' when the window is closing.

In order to load a page you have to have a window....

If we login to the application again request.getsession(true) will ...