Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

logout from page with frames

 
michael yue
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65229
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic