Reputation: 119
My code is this :
<%
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Cache-Control", "no-store");
response.setDateHeader("Expires", 0);
response.setHeader("Pragma", "no-cache");
%>
${Sess_Var}
<c:if test="${empty Sess_Var}" >
<%
response.sendRedirect("doLogin.obj");
%>
It is Not working because on clicking on back button it show the previous page.. What should i do?
Upvotes: 3
Views: 3316
Reputation: 28830
You have to provide the browser (client) with the correct headers.
Try
<%
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache, no-store, must-revalidate");
response.setDateHeader("Expires", "0");
%>
See also this page for cross-browsers information.
Upvotes: 2