Click to See Complete Forum and Search --> : Rederect after killing sessions


moiseszaragoza
08-27-2007, 10:08 AM
I have a Button that passes a variable that kills all my sessions

<a href="default.asp?logout=y"> log out </a>

then my code read


dim seLogout
seLogout=request.QueryString("logout")
if (seLogout = "y") then
session.Abandon()
response.Redirect("default.asp") // This line does not happened
end if


its not redirecting me because i sell my page with all the sessions still active i have to refresh 1 more time to see my page with no sessions
any ideas how to fix this ?

Terrorke
08-28-2007, 01:17 AM
here is a little explanation of the abandon method :

The Abandon method terminates a user session, destroys all the objects in the current Session object, and releases its resources. However, this deletion will not occur until all of the script is processed for the current page. When the session ends, the OnEnd event handler is called. By default, even if you do not call Abandon, the Session object is terminated after twenty minutes of idle time.

Maybe the line in bold has something to do with the not redirecting. Have you tried your code without the session.abandon statement?

moiseszaragoza
08-28-2007, 10:36 AM
Thanks
The code works fine with out the session.abandon statement