I am trying to clear session variables after I have logged out. In my search.aspx I have a logout button therefore I put the below code in search.aspx.vb. However it does does seem to work.
Protected Sub hlLogout_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles hlLogout
{
if(Session["User Name"]!=null) Session.Remove("User Name");
if(Session["Password"]!=null) Session.Remove("Password");
Response.Redirect("Default.aspx");
}
As I am new to sessions etc. I am not even show if I have put it in the right place, or if I need more code elsewhere in my application. Could anyone help me with this issue?
Thank you