Due to some security constraints, there is requirement that the page visited should not be listed in browser’s history.
So the pages need not to be shown in the history at all.
I have tried following ways but failed.
Solution 1:
1. <%
2. session.invalidate();
3. response.setHeader("Cache-Control","no-cache");
4. response.setHeader("Cache-Control","no-store");
5. response.setDateHeader("Expires", 0);
6. response.sendRedirect("home.jsp");
7. %>
Solution 2:
<%
Response.Cache.SetExpires(DateTime.Parse(DateTime.Now.ToString()))
Response.Cache.SetCacheability(HttpCacheability.Private)
Response.Cache.SetNoStore()
Response.AppendHeader("Pragma", "no-cache")
%>
Solution 3:
<body onload="history.forward()">
Solution 4:
<%
response.setDateHeader("Last-Modified", System.currentTimeMillis());
%>
Like in Firefox, there is functionality Tools -> Start Private Browsing which doesn’t store any session data. Is there anything that can be done by JavaScript to achieve this.
You can’t rely on client side when security matters. All browsers have different implementation for history. You should rely on a server side solution.