Click to See Complete Forum and Search --> : Problem with session.


Alsvha
February 18th, 2005, 06:50 AM
I've witnessed (not mine, a colleges) a wierd problem today.

It seems that Session_On_Start is fired when a response.redirect to the page itself is called in the code. Does anybody have experience with this problem?
(asp.net using vb.net)

Basically -
Session_On_Start sets a varialbe "login" to false (Session("login") = false)

Then a login page is run where the user can log in, where if correct it will set the session variable to true
Session("login") = true
and then response.redirect to the default.aspx page again.
However when redirected - the Session_On_Start is fired again, thus not using the logged in data but creating a new instance of the Session(login) variable.

What is extreemly wierd is that this procedure have been done in other projects (including some of mine) and works fine there.

I've checked Session ID (Trace.IsEnabled) and it is the same ID both before and after the redirect.
I've also tried to enable all cookies (the browser was at standard settings) and it didn't do any difference.

The most wierd part is that if the user types a *wrong* password the first time, and then the correct afterwards - it works?

Is there anybody that could make some sences of this rambleing and possible have advice?

Alsvha
February 18th, 2005, 08:49 AM
Nevermind - problem has now been solved.
It was an unhandled exception deep in some related code which caused the problem.