Hi all, I m a newbie and new to this site as well, I am working on a webapplication using Servlets,Jsp and JavaScript..the user logs into my application and after finishing his task he logs out,but even after logging out i.e(session.inv alidate()) by saying back he can see the previous page when in turn he should be getting a 'you are logged out' or 'session expired message' ..can anyone help me with this ...Thanks in advance!
Servlets + Jsp
Collapse
X
-
hello,Originally posted by abctechHi all, I m a newbie and new to this site as well, I am working on a webapplication using Servlets,Jsp and JavaScript..the user logs into my application and after finishing his task he logs out,but even after logging out i.e(session.inv alidate()) by saying back he can see the previous page when in turn he should be getting a 'you are logged out' or 'session expired message' ..can anyone help me with this ...Thanks in advance!
just try this
<%
response.setHea der("Cache-Control","no-cache"); //HTTP 1.1
response.setHea der("Pragma","n o-cache"); //HTTP 1.0
response.setDat eHeader ("Expires", 0); //prevents caching at the proxy server
response.setHea der("Cache-Control","no-store"); //HTTP 1.1
%>
<%
if(session.getA ttribute("userI d")==null)
{
res.sendRedirec t("../error.html");
}
%> -
Hi Shanaj,
Thanx fr replyin, but actually i'd already used these headers in my page, still not working. I have designed my page using Front-page so I hd jst set these headers as Meta tags with the 'HTTP-EQUIV' attribute..and in my Jsp I'm just checking the session obj , as far the processing is concerned , all that is done in a Servlet,
The thing is that I've a webappln in wich a user after logging in fills up certain subscriptions and there is a 'logout' link on every page,on clicking it the user's session is invalidated saying session.invalid ate() . Then on all the pages I just check if the session = null , if yes then the user should be redirected back to the home-page..but the thing is that on saying back the control doesn't even go into the scriptlet in order to chek this..it just directly displays the previous page ...and thus u cn see all the previous pages just by saying 'previous' and 'forward'. I' m still working on it and as a temp solution I've disabled the ''back' button thru JavaScript.
-------------------------------------------------------------------------------------------------------------------
Originally posted by Shanajhello,
just try this
<%
response.setHea der("Cache-Control","no-cache"); //HTTP 1.1
response.setHea der("Pragma","n o-cache"); //HTTP 1.0
response.setDat eHeader ("Expires", 0); //prevents caching at the proxy server
response.setHea der("Cache-Control","no-store"); //HTTP 1.1
%>
<%
if(session.getA ttribute("userI d")==null)
{
res.sendRedirec t("../error.html");
}
%>Comment
Comment