• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Logout, Browser back button problem

 
jay Rotti
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1467
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PLease refer to this thread.
http://www.javaranch.com/ubb/Forum7/HTML/002876.html
regds
maha anna
 
jay Rotti
Greenhorn
Posts: 9
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic