2

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

cagin
  • 5,481
  • 14
  • 72
  • 127

2 Answers2

1

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

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

Community
  • 1
  • 1
Aliostad
  • 78,844
  • 21
  • 155
  • 205
  • I wrote Session.Abandon() but my problem dosent solved. I can go the pages how i write page url on the url area and i m sure of cheking Sessions on the page load events. – cagin Oct 21 '10 at 12:53
0

Try Session.Abandon Method

PRR
  • 1,160
  • 7
  • 13