Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to avoid browser back button after logout

 
zimbu bolleddu
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

How to restrict or avoid browser back button after logout.
I have performed :
1) session.invalidate()
2) delete cookies.
But whenever I clicked on back button it shows previous page.

Please anybody help me out. Code examples are highly appreciated.

Thanks in advance
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are checking the session , for each request thru action class, then by chance the user clicks on back button and got the previous page, he cant do anything, because session has been expired and he cant perform any activity, he need to login again !!
 
zimbu bolleddu
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply.

Yeah he can't do anything but I don't want allow him to click on back button,
If he/she clicked on back button it should display session expired or any specified error message.

Thank you ..
 
Rishi Varma
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the samething applies.
You need check the session in each action class; if the session is invalid; throw an exception and catch.

and simply forward to the corresponding error page from the catch block.
Hope you get this.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
have you googled it ?
[ July 09, 2008: Message edited by: Sagar Rohankar ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic