禁用 CLIENT_CERT 身份验证 Web 应用程序的浏览器后退按钮
我的 web 应用程序有一个基于 CLIENT_CERT 的 JAAS 身份验证。我用的是IE7。
当我单击“注销”时,它会将我带到我的主页。现在点击后退按钮,用户应该保持在同一页面上,这是我使用history.forward() javascript实现的。但由于上一页已受到保护,因此会出现证书对话框。
当用户注销后单击后退按钮时,如何避免证书对话框不出现并保留在非安全主页上。
My webapp has a CLIENT_CERT based JAAS authentication. I am using IE7.
When I click on logout, it takes me to my home page. Now clicking on the back button, the user should remain on the same page, which I acheived using history.forward() javascript. But the certificate dialog comes up since the previous page was secured.
How can I avoid the certificate dialog from not coming and also remain on the non-secure home page when user clicks on back button after logging out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
禁用窗口内后退按钮的唯一方法是对每个交互使用 location.replace() ,如果您需要提交任何表单,则无法执行此操作,除非您将它们定位到隐藏的 iframe,然后执行 location.replace () 响应表单提交后 iframe 的 onload 事件。这真的很令人讨厌并使一切变得复杂。
另一种避免用户返回页面的技术(一些网上银行网站就是这样做的)是在新窗口中启动安全部分,并通过注销将其关闭(您可以使用
window. opener = null;
在window.close();
之前。The only way to disable the back button within a window is to use location.replace() for every single interaction, which you cannot do if you need to submit any forms unless you target them to a hidden iframe and then do a location.replace() in reaction to the iframe's onload event once the form is submitted. This is really nasty and complicates everything.
The other technique to avoid users going back through pages (some online banking sites do it this way) is to launch the secure section in a new window, and have logout close it (you can force a close in IE with
window.opener = null;
beforewindow.close();
.