Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 24th, 2003, 04:24 PM
flauto flauto is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 1 flauto User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
jsp/Beans Logout - no back-Button!

I' m programming a webapplication with jsp and JavaBeans. I use a LoginBean to validate the user's ID and password and it works fine. But if the user logs out (and I invalidate the session) there is a problem: the user logs out and comes to the startpage. But then he might use the Back-Button of his Browser and so comes to an invalid page.
I would like, that the Back-Button always direct the user to the current startpage, so that he actually can't go back...

Perhaps this is a very simple problem, sorry, but I can't find an answer....

Can someone help me?

Reply With Quote
  #2  
Old April 26th, 2003, 11:23 AM
Nemi Nemi is offline
Clueless llama
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Feb 2001
Location: Lincoln, NE. USA
Posts: 2,353 Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level)Nemi User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Days 12 h 35 m 19 sec
Reputation Power: 111
The reason you can find no answer is because this is not done in web applications. What you want to do is very basic - in a typical client application, NOT a web application. A common misconception for programmers to make when designing a web application is to try and force the order of access to the pages in the application. This is easily done if you are designing a GUI app, but is near impossible to do in a web based app. Therefore, instead of trying to force the user to do what you want (which is, for all practical purposes, impossible), design your app so that it does not matter what page they request, it will still work.

You have to realize that the back button is not programmable to you as a web programmer. When a user hits the back button, they will often get a cached copy of the page. It does not neccessarily re-request from the server. Because of this, you are very limited what you can do. There are header tags you can use to tell the browser not to cache the page, but IE convieniently ignores them if a page is over a certain size.

Believe me, I have been where you are and have come to the conclusion that you always assume a user can request any page at any time and that a cached copy might be used. Always verify your session data is valid when doing any transactions. This is important so I will repeat - always make sure the session data is valid whenever you try and use it and if it isn't redirect the user to log in.

I rarely invalidate sessions. As a rule, you should not have a lot of data in the session. This is a huge performance hog on the server. Given that, if you leave the default session timeout to 30 minutes, I have found it is better to just let the server invalidate the session after timeout.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > jsp/Beans Logout - no back-Button!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway