Wednesday, September 2, 2009

code for logout in C#

Try this code may this will help. Paste this code on masterpage’s load event.
If you are not using master pages then you have to paste this code of all the pages (on load event).

Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();

In logout page:

Session.Clear();
Session.Abandon();
// clear all session....

run ur application.............................jsm