<%
response.setHeader("Cache-Control","no-cache,no-store,must-revalidate");//HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>
after logout, on comming login page if you click back button it shows old page as it is logged in. I am using above 3 lines in a jsp and I am including this in all my jsps inside body tag. this is not working for some jsps . what are the things we need to consider for stoping cacheing after loggout . If a jsp having a form with Post method , this technique does not work ?.
In my Logout action I am doing this.
Cookie logoutCookie = new Cookie("somename", null);
logoutCookie.setPath("/somename");
logoutCookie.setMaxAge(0);
ServletActionContext.getResponse().addCookie(logoutCookie);
Thanks.