Session.Abandon - Problem
-
Hello Webstars ;-) I have a big Problem with the instruction "Session.Abandon();". I hava a login/logout mechanism and the session-data should be erased after login out. So I call "Session.Abandon();". After that I wanted to Redirect the client to my login-site. So that my code looks like that:
private void btnRelogin_ServerClick(object sender, EventArgs e) { Session.Abandon(); string url = "Login.aspx"; Response.Redirect(url, false); }
But my Session data was not erased, why? Same result with "Session.Clear();" What can I do to solve this problem? Thanx for any help. Ciao Norman-Timo -
Hello Webstars ;-) I have a big Problem with the instruction "Session.Abandon();". I hava a login/logout mechanism and the session-data should be erased after login out. So I call "Session.Abandon();". After that I wanted to Redirect the client to my login-site. So that my code looks like that:
private void btnRelogin_ServerClick(object sender, EventArgs e) { Session.Abandon(); string url = "Login.aspx"; Response.Redirect(url, false); }
But my Session data was not erased, why? Same result with "Session.Clear();" What can I do to solve this problem? Thanx for any help. Ciao Norman-TimoHi there Try with Response.Redirect(url) << >>
-
Hello Webstars ;-) I have a big Problem with the instruction "Session.Abandon();". I hava a login/logout mechanism and the session-data should be erased after login out. So I call "Session.Abandon();". After that I wanted to Redirect the client to my login-site. So that my code looks like that:
private void btnRelogin_ServerClick(object sender, EventArgs e) { Session.Abandon(); string url = "Login.aspx"; Response.Redirect(url, false); }
But my Session data was not erased, why? Same result with "Session.Clear();" What can I do to solve this problem? Thanx for any help. Ciao Norman-TimoHello and thanx! The Redirect without the boolean-parameter doesn't work too. But that was not the problem :-) I shot a own goal with the fact, that I held my Session data in a class variable. So a reference to the session was always held. And so I think ASP.NET doesn't performed my Session.Abandon(). After a Response-Redirect the reference was still active, so I didn't gave ASP.NET a chance to make the Session abandonded. X| Ok, now I solved the problem, because first I destroyed every reference to the session data. So on, Norman-Timo