File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Login and logout problem with sessions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Login and logout problem with sessions" Watch "Login and logout problem with sessions" New topic

Login and logout problem with sessions

Aditya Vasudeva
Ranch Hand

Joined: May 27, 2008
Posts: 76
I have a login page which takes in a username and password and forwards to a welcome.jsp if login is successful.

Once I logout, I invalidate my session. Unfortunately, if i click the back button, the welcome.jsp page comes back again. This is incorrect.

How do i stop the welcome.jsp from coming back. Instead, another page should load saying that the session has expired.

I went through a few forums in which i learnt that the browser cannot be controlled and that meta-tags have to be used to prevent the browser to cache data. I tried using the following tag to disable caching but it did not work:

Please help. This is very frustrating.
Thank You.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

See this Servlet FAQ entry.

[Asking smart questions] [About Bear] [Books by Bear]
ou yang

Joined: Oct 14, 2008
Posts: 10
oh,there are some problems on your would send your coding to the web size so that we can find your errors.
I agree. Here's the link:
subject: Login and logout problem with sessions
It's not a secret anymore!