禁用后退浏览器的按钮,点击退出像Yahoo,Gmail会等安全 [英] Disabling Back button of Browser on Logout click like Yahoo,Gmail etc for Security

查看:130
本文介绍了禁用后退浏览器的按钮,点击退出像Yahoo,Gmail会等安全的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我设置会话变量作为会议[的SessionID]在globle.asax文件,如下: -

First, I am setting the session variable as Session["SessionId"] in the globle.asax file as below:-

void Session_Start(object sender, EventArgs e) 
{
  // Code that runs when a new session is started
  string sessionId = Session.SessionID;
  Session["SessionId"] = "true";
}

我用这code在母版页的的Page_Load()事件: -

I am using this code in the page_load() event of master page:-

Response.Buffer = true;
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1d);
Response.Expires = -1500;
Response.CacheControl = "no-cache";

if(Session["SessionId"] == null)
{
  Response.Redirect("PatientLoginPage.aspx");
}

和使用Firefox作为默认布劳尔,但它不是在它的工作,以及镀铬broweser纠正我,如果我错了,请帮我...

and using Firefox as my default brower, but it is not working in it as well as Chrome broweser correct me if i am wrong please help me...

由于提前,

Vaibhav的ð。

vaibhav D.

推荐答案

如果我没有记错,Gmail和雅虎使用2重定向,所以当你点击返回你真的回去一个假网页,你不注销前的人。
尝试到相同的。

If i'm not mistaken, Gmail and Yahoo use 2 redirects when logging out, so when you click "back" you actually go back to a bogus page, not the one before you logged out. Try to to the same.

还用可能会影响浏览器历史记录或没有(我这里reffering从HTTP标头或从一个简单的JavaScript重定向重定向)重定向类型

Also the type of redirect used might affect the browser history or not (i'm reffering here to redirect from the http headers or a redirect from a simple javascript).

尝试实验这个信息和一个假的代理页面littpe,充当模式之间的中间loggen中和退出模式。

Try to experiment a littpe with this info and a bogus "proxy" page, that acts as an intermediate between the mode "loggen in" and the "logged out" mode

这篇关于禁用后退浏览器的按钮,点击退出像Yahoo,Gmail会等安全的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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