aspose file tools*
The moose likes Servlets and the fly likes Logging out issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Logging out issue" Watch "Logging out issue" New topic
Author

Logging out issue

Prashant Langade
Ranch Hand

Joined: Jul 01, 2009
Posts: 73
How to handle back button issue after logging out from web application?

In detail..

If we log out from the application and again if we press back button from browser then it again redirects back to the page where we were before logging our..

So how do we handle this type of issue?


Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Login--[redirect]----->Home page--->Logout-----[Redirect]--->Login Page and Clear Browser Cache .Importantly Check the Valid Session .
Prashant Langade
Ranch Hand

Joined: Jul 01, 2009
Posts: 73
I wanted to know how this can be programatically achieved???
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Prashant Langade wrote:how this can be programatically achieved???


what do you mean by programatically ? your program[web application] should follow certain design right?

also search here(javaranch) for PRG Techniquie
Prashant Langade
Ranch Hand

Joined: Jul 01, 2009
Posts: 73
By saying "Programatically", i mean to say that either back button of the browser should get disabled upon logging out or even if it not,then upon clicking back button,it should not redirect to the previous page.

What is PRG?



Prashant
senthil doraiswamy
Greenhorn

Joined: Feb 14, 2002
Posts: 9
When user clicks log-out button, clear authentication info where ever you may have (commonly cookies ?) and forward / re-direct user to the log in page. I guess you can also play a bit on the browser URL history.

good luck, sen




--- sen.
Roberto Hernandez
Ranch Hand

Joined: Apr 29, 2009
Posts: 33
If you use session objects, make sure you invalidate the session.


Also inside your JSP, add a snippet of code that checks whether the authentication object is still in session. If not, then redirect the user to the login.jsp page

Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

senthil doraiswamy wrote: I guess you can also play a bit on the browser URL history.


Don't Highly Discouraged
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Logging out issue