I have a page with 2 frames. Each of them check for session whether there is a user login or not. There is also 1 page that when called will display the page in frames(its a frameset page). I also check for session in this page. Now the problem is how do i logout/invalidate session from all this 3 pages at once when user click logout. The logout button is on the left frame of my page. Currently when I logout, the other frame is still in session.
Ditto on the recommendation to stop usng frames, but you can try adding a target="_top" to the logout button. The response will then replace all your frames. (Unless I've forgotten how to use frames. It's possible)
hi, we can use some java scripting to achieve the same.On click of Logout ,cll the java script function to load into the whole frame
i have used this technique earlier.shd work for u also. Thx and regards -Srini
Joined: Nov 20, 2003
Actually just now I figured out my problem. Its when I log in, if successful the login servlet perform a forward request to the welcome page. This cause the url to become the login servlet's url and it remains like that wherever any other links i clicked. Then I change to use redirect and the url does not stuck on the servlet's url again and i can logout completely. If use forward, after logout pressing back button and hitting refresh will make the user being logged in again. It seems that using forward has some disadvantage like what I discovered. So when is the best times to use forward instead of redirect?
Joined: Mar 18, 2004
Use redirect when the request object is not needed. I mean in redirect a new request object is created.
In case of forward the new request object is not created. the request object is forwarded to the next page as it is.