ブラウザセッションを無効にするにはどうすればよいですか。私はJSPを使用しています。web.xml
で180秒に設定されているので、そのsession-timeout
ようにしたいだけです。ただし、問題は特別な場合にあり、フォームの送信直後に一部のユーザーのブラウザセッションを無効にする必要があります。
私はsession.invalidate();
セッションを無効にするために使用し、また使用しました
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Pragma", "no-cache");
response.setDateHeader("Expires", 0);
ただし、戻るボタンをクリックすると、同じユーザーセッションに移動します。これはブラウザのキャッシュから読み込まれていますか?
これは私が私の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>
私は何かが足りないのですか?