clearing session values saved from a http handler file in asp.net

175 views Asked by At

I am working on a http handler file where I am setting some session values,

I am unable to clear these sessions on logout button(on a different page).

  • My logout button is on master page.

  • I am not saving session values in cookies.

I am using below interface in handler file :-

public class abc : IHttpHandler, System.Web.SessionState.IRequiresSessionState

Handler file setting session value:-

context.Session["CheckInId"] = 1;

Logout button's code:-

protected void lbtnLogout_Click(object sender, EventArgs e)
    {
        try
        {
            Session.Abandon();
            Session.Clear();
            Session.RemoveAll();           
        }
        catch (Exception ex)
        {           
        }
    }
0

There are 0 answers