aspose file tools*
The moose likes JSP and the fly likes logout from page with frames Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "logout from page with frames" Watch "logout from page with frames" New topic
Author

logout from page with frames

michael yue
Ranch Hand

Joined: Nov 20, 2003
Posts: 204
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.

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60056
    
  65

No, it's not. Once you invalidate the session, it's invalid regardless of window/frame.

Nothing, on the other hand, will automatically remove the "stale" page from other frames/windows.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ali Gohar
Ranch Hand

Joined: Mar 18, 2004
Posts: 572
By the way its not a good idea to use Frames. See <div> tag of HTML. It can help you. It will also help you to make your HTML pages more attractive.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

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)
Srinivas Gogineni
Greenhorn

Joined: May 06, 2004
Posts: 6
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

in that javascript write top.location.href="Login.jsp"

i have used this technique earlier.shd work for u also.
Thx and regards
-Srini
michael yue
Ranch Hand

Joined: Nov 20, 2003
Posts: 204
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?
Ali Gohar
Ranch Hand

Joined: Mar 18, 2004
Posts: 572
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: logout from page with frames
 
Similar Threads
Logoff problem
Frames Problem
User Session Management
sign out code in a multiframe jsp
logout problem