开发者

Session killed but page is coming

开发者 https://www.devze.com 2023-01-21 12:57 出处:网络
I m using session in my project and i wrote Session.Clear(); Response.Redirect(\"Login.aspx\"); under the logout button. And i m cheking Session[\"user\"] in all pages\'s page load event. if it i

I m using session in my project and i wrote

Session.Clear(); 
Response.Redirect("Login.aspx");

under the logout button. And i m cheking Session["user"] in all pages's page load event. if it is null i am sending user to Login.aspx. But pages are coming without go to page开发者_开发百科 load event when i write a page to url however i clicked Logout button.

Do you have any idea?

Thanks in advance

Çağın


Session.Clear() only clears values in session dictionary. Use Session.Abandon().

In ASP.NET, when should I use Session.Clear() rather than Session.Abandon()?


Try Session.Abandon Method

0

精彩评论

暂无评论...
验证码 换一张
取 消