|
-
Jul 11th, 2007, 12:14 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] I've tried clearing session but the session is still there. What could be happ[2005]
// 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";
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|