此网页有重定向循环 [英] This webpage has a redirect loop
本文介绍了此网页有重定向循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
void Session_Start(object sender, EventArgs e)
{
if (Session.IsNewSession)
{
HttpCookie sessionCookie = Request.Cookies["ASP.NET_SessionId"];
if ((null != sessionCookie) && !string.IsNullOrEmpty(sessionCookie.Value))
{
Response.Redirect("login.aspx?ReturnUrl=" + Request.Url.LocalPath);
}
else
{
return;
}
}
else
{
if (Session.Count == 0)
{
Response.Redirect("login.aspx?ReturnUrl=" + Request.Url.LocalPath);
}
else
{
return;
}
}
}
void Session_End(object sender, EventArgs e)
{
if (Session.Count==0)
{
return;
}
else
{
Application.Lock();
Application["UsersOnline"] = (int)Application["UsersOnline"] - 1;
Application.UnLock();
Session.Clear();
}
}
在注销后,它将重定向一个循环..请任何人帮助我..
谢谢Advance ..
in this after logout it will redirects a loop .. please help me any one ..
Thanks Advance..
推荐答案
您应该使用session.abondened而不是session.clear.
试试吧
you should use session.abondened rather than session.clear.
try it
这篇关于此网页有重定向循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文