// Clear all session variables
Session.Clear();
// Removes a particular session variable
Session.Contents.Remove("LoggedIn");
Session["LoggedIn"] = "false";
Session["CurrentUser"] = null;
Session["CurrentPass"] = null;
Session.Abandon();

I've tried these all to no avail. I am wondering what could be causing a page to recreate the session. But first, any of these right? I just don't understand why when I click the link that the variables aren't clearing. Here's the code I am using in the link button.

protected void registerlnkbttn_Click(object sender, EventArgs e)
{
// Clear all session variables
//Session.Clear();
// Removes a particular session variable
//Session.Contents.Remove("LoggedIn");
//Session["LoggedIn"] = "false";
//Session["CurrentUser"] = null;
//Session["CurrentPass"] = null;
//Session.Abandon();
// Reset pages back to non logged in state
loginlnkbttn.Text = "Log In";
loginlnkbttn.PostBackUrl = "login.aspx";
registerlnkbttn.Text = "Register";
registerlnkbttn.PostBackUrl = "register.aspx";
}
}