• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Logging out issue

 
Prashant Langade
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Login--[redirect]----->Home page--->Logout-----[Redirect]--->Login Page and Clear Browser Cache .Importantly Check the Valid Session .
 
Prashant Langade
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wanted to know how this can be programatically achieved???
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Roberto Hernandez
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
senthil doraiswamy wrote: I guess you can also play a bit on the browser URL history.


Don't Highly Discouraged
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic