File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Session Tracking Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Session Tracking" Watch "Session Tracking" New topic
Author

Session Tracking

Vishal Manchanda
Greenhorn

Joined: Aug 27, 2003
Posts: 1
How can we make the "Page Expired" option when user
> clicks on the Back button of the browser?(I am talking
> with respective Session tracking)
> I mean after coming to Logout page,instead of
> Logging out,if the user clicks on the Back button of
> the browser,it again opens returns main page without logging in.
I'm using JSP
session.invalidate is not working.
then i tried clearing the cache using
response.setHeader("Cache-Control","no-store");
response.setHeader("Pragma","no-cache");
response.setDateHeader ("Expires", 0);
but now the exact situation is
if I login I enter the main page and then logging off brings me back to login page.
Now pressing the browser back button it shows something like
"page has expired press refresh button"
pressing the refresh button a dialog asks retry or cancel
if I press retry It again opens the main page without logging in.

Can you tell me how it will be done..?
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 613
Vishal,
Try this,if it helps u,
Keep the code of cache as it is and
add following lines at top of ur jsps.
if(session.getAttribute("userid")==null)
response.sendRedirect("login.jsp")
and add value to userid in session at login.
and invalidate session after logoff
regards
Praful
[ October 14, 2003: Message edited by: Praful Thakare ]

All desirable things in life are either illegal, banned, expensive or married to someone else !!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Session Tracking
 
Similar Threads
Session problem plz
Expiring a page
How to take back the user to his personal page after a refresh
Send response to login page
Browser Back Button and Caching