File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Logout Problem - Session related

 
Vaibhav Sharma
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing some problem in session handling. Actually, when a user clicks on logout link, he is taken to logout.jsp where the session is invalidated. and if he uses browsers back button 2 to 3 times he reaches on the previous page.
After refreshing the window 2-3 times, browser asks for resending the POST data and maintains the session again.How can i control the user from going back to the previous page? Please help me out...

I hope my problem is clear.I want to stop user from regaining the access after logout.What procedure shall i use ?
 
Amol Fuke
Ranch Hand
Posts: 129
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vaibhav ,

On every page , check if session is valid.If it is not valid , forward/send it to logout.jsp

Thanks,
Amol
 
Vaibhav Sharma
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems that you have not understood my question properly. What you are saying is one aspect of it, which i understood very well.
But my problem is one step ahead of what you are thinking of ?
In my case, if i somehow goes back to the page using browser back button, which eventually contains some postdata, then browser asks us to resend the post data and hence again maintains the session.
 
Kunal Jag
Ranch Hand
Posts: 31
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On every page , check if session is valid.If it is not valid , forward/send it to logout.jsp

If you call the HttpServletRequest.getSession(false) method and the method returns null, then the user does not have a valid session; the container considers this to be the first request and she must be redirected to the login page.
 
Pham Hoai Van
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you need some javascript skill. Clear browsing history when reach logout page, user will have no chance to turn back.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic