wood burning stoves 2.0*
The moose likes Servlets and the fly likes Logout, Browser back button problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Logout, Browser back button problem" Watch "Logout, Browser back button problem" New topic
Author

Logout, Browser back button problem

jay Rotti
Greenhorn

Joined: Apr 05, 2001
Posts: 9
I have similar situation as above.
When user logoff
session.invalidate();
response.sendRedirect("login.tml");
but after going to login.html if user clicks browser back button it display's the contnts of the page. How do I prevent it. Any help appreciated. I have a peice of code in a page when user clicks browser back button to know the session and prevent, but still doesn't work.
In netscape ir works I guess:
Data Missing
This document resulted from a POST operation and has expired from the cache. If you wish you can repost the form data to recreate the document by pressing the
reload button.

but IE it shows contents of the page.
Please any help appreciated.
Thanks
Jay Rotti
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
PLease refer to this thread.
http://www.javaranch.com/ubb/Forum7/HTML/002876.html
regds
maha anna
jay Rotti
Greenhorn

Joined: Apr 05, 2001
Posts: 9
Thanks maha anna
but let me re frame my problem.
All the cache preventing methods and session invalidation works absolutley fine in Netscape but it doesn't work in IE, do you think anything wrong in my prog?
Have a look(this a page which gets displayed even after session is invalid and when user hits browser back button)
I am cinfident that it si caching because when I refresh the same page it doesn't dipaly the contents"
<%@ page language="java" contentType="text/html" %>
<%
response.addHeader("Pragma", "No-cache");
response.addHeader("Cache-Control", "no-cache");
response.addDateHeader("Expires", 0);
response.setDateHeader("max-age", 0);
if (session.getAttribute("fullname") == null)
{
out.println("Sorry You are not allowed to view the contents of the page");
}
else
{
%>
<html>
<head>
<title>All Tickets</title>
<meta http-equiv="refresh" content="text/html; charset=iso-8859-1" >
</head>
<body>
<% out.println(rs.getString("name")); %>
</body>
</html>
Thanks
Jay rotti
 
Don't get me started about those stupid light bulbs.
 
subject: Logout, Browser back button problem