如何在单击后退按钮或按退格按钮后注销后停止重定向先前记录的页面 [英] How to stop redirecting previous logged page after logout when clicking back button or pressing backspace button

查看:79
本文介绍了如何在单击后退按钮或按退格按钮后注销后停止重定向先前记录的页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

点击后退按钮或按退格按钮后如何停止重定向先前登录的页面................... plz help ......... .....

How to stop redirecting previous logged page after logout when clicking back button or pressing backspace button................... plz help..............

推荐答案

将所有会话变量设置为空

它可以解决你的问题
set all the session variable to null
it might solve your porblem


嗨Shinju,



我在项目中遇到了同样的问题。我认为它的浏览器行为,当您在浏览器中按下后退按钮后退出它会移动隐式地显示上一页,如果你点击该页面上的任何控件,那么如果你已经实现了在注销时清除所有会话的代码,那么它将不允许你做任何功能。



您的问题的其他选项是



1)您可以在退出后禁用后退按钮(不可取)

2)重定向到另一个页面,并检查用户会话,如果它是空的,然后重定向到登录页面。



我希望这会对你有所帮助。



问候,

RK
Hi Shinju,

I faced the same issue in my project.I thinks its browser behavior,After logout when you press back button in the browser it will move to previous page implicitly and if you click any control on that page then it will not allow you to do any functionality if you have implemented code to clear all session while logout.

Other options for your question is

1)You may disable back button once logged out(Not preferable)
2)Redirect to another page, and there check user session, if it is empty then redirect to login page.

I hope this would help you a bit.

Regards,
RK


这篇关于如何在单击后退按钮或按退格按钮后注销后停止重定向先前记录的页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆