mthalis wrote:
i have already implemented login, logout parts using struts(jsp). But the
case is after logged out, when i press  back button it is redirected to the
particular page that i was in before logged out. these are my codings, and
plz kind enough to give me reasonable answer.
//set sessions//
        HttpSession session=request.getSession();
        session.setAttribute("userName", userLoginForm.getName());

//verify log or not
<%
String userId=(String)session.getAttribute("userName"); if(userId != null){
 %>
        

///if not log
<%
}
else{
        response.sendRedirect("./index.jsp");
}
%>

//logout
<%
session.removeAttribute("userName");
session.invalidate();
response.sendRedirect("./welcome.jsp");
 %>


Leaving the discussion about the scriptlets aside, and that this isn't really a Struts issue...

When the user hits the "back" button if a page has been cached it will be displayed--no server interaction, so no server interaction. Turn off page caching--this forces the browser to go back to the server, whereupon it will discover the user is no longer logged in, and run the... scriptlet.

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to