I had designed a web application with username/password logging in a
JSP page and verification process in a
servlet. I use sendRedirect to redirect to another JSP page with the message Welcome User. The problem I am facing is I am unable to stop the browser from caching web pages.
After logging in when I use BACK browser button I see the same form just submitted with the same values filled in. This is not my current state. Since user has already logged in when I use the back browser button both username/password text fields should be empty. This is what I am expecting. I used all cache controlling techniques
I included this in my Login JSP page
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
and in servlets
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Expires", "0");
response.setDateHeader("Expires", 0);
But nothing is working. I appreciate if anyone can suggest how to solve this issue.