How can I cancel a browser session. I am using JSP. The web.xmlparameter is session-timeoutset to 180 seconds, and I want it to be like that. But the problem is that for some user browser sessions, you must immediately cancel immediately after submitting the form.
I used session.invalidate();to cancel the session and also used
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Pragma", "no-cache");
response.setDateHeader("Expires", 0);
But still, when I click the back button, it will lead me to the same user session. Is this loading from the browser cache?
This is what I have in my JSP:
<head>
<script type="text/javascript">
function submitForm(){window.document.submitFrm.submit();}
</script>
</head>
<body onload="submitForm()">
<%String output = (String)(request.getAttribute("strOut"));
String hookUrl = (String)(request.getAttribute("hookUrl"));
System.out.println("hookUrl in cwsGroup.jsp : "+hookUrl);%>
<form method="post" action="<%=hookUrl%>" name="submitFrm" id="submitFrm">
<input type="hidden" name="cxml-urlencoded" value='<%=output%>' />
</form>
<%
response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","no-cache");
response.setDateHeader( "Expires", 0 );
session.removeValue("domineName");
session.invalidate();%>
</body>
Did I miss something?
source
share