为什么会话变量的值在所有破坏代码之后仍然存在?
login.aspx的
if (IsPostBack == false)
{
//destroy any login information
Session["password"] = "false";
Session["login"] = "false";
Session.Abandon();
Session.RemoveAll();
}
if (TextBox2.Text == main_password)
{//then he is website server admin
Session["password"] = "password";
Session["login"] = "true";
Response.Redirect("~/TABLE.aspx");
}
table.aspx
//checking if website server admin
if ("password" == (string)Session["password"])
{
link_logout.Enabled = true;
}//if ends
else
{//not authorized
Response.Redirect("~/Identify.aspx");
}//else ends
当我单击注销链接时
登录页面被加载,导致所有会话状态的破坏。
登录页面确认当我使用response.write
查看会话变量的值时。
当我提供用户名和密码并单击登录时,它会重定向到表页面。
当我点击退出时,它会重定向到登录页面,登录页面会破坏信息。
问题
登录信息销毁后,我点击表链接进入表页,如NO NO所示,重定向到登录页面。
但如果我复制粘贴表页面的网址,那么无论我做什么,它都允许我查看页面。也就是说,即使值被销毁,它也会将会话变量和evalutes的值设置为TRUE。
我不能使用asp.net登录功能,我的限制不允许我使用该控件。
没有找到相关结果
已邀请:
2 个回复
凄嘛姥
授巨