Click here to Skip to main content
15,886,864 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
Hi all
i am using asp.net 2.0. I have develop web application.
i have problem for Session.Abandon()
this method works fine on my local machine but when i deployed it to IIS, and press LOGOUT. it will hangs browser and does nothing what should i do ?

Here is the code that i used

VB
Session.Clear()
Session.Abandon()

Response.Redirect("../../Default.aspx")


Googling suggest me to remove Session.Clear() but problem continues.

Thanks in advance
Posted
Updated 4-May-11 4:47am
v3
Comments
thatraja 4-May-11 10:46am    
Any error message? check in firefox error console....if you found anything then include that in your question.
Sandeep Mewara 4-May-11 10:48am    
Did you debugged the hosted site? Try out and see where it is getting stuck.
Monjurul Habib 4-May-11 15:33pm    
are you using asp.net form authentication ?

Are you still within your secured area when you abandon your session? It might be that the server is trying to deliver a page that the user no longer has permission to receive.

Have the log out button execute a Response.Redirect("PageOutsideSecureArea.aspx"), with that page abandoning your session. The page can then either automatically redirect to your default page, or have a polite "You have been logged out" message and a link to the home page (which, IMO, is better design.)
 
Share this answer
 
You can try something like this instead:

Session.Contents.Remove("yoursessionid");
Response.Redirect("http://mysite.com/Default.aspx")


You'll probably want to figure out a way to properly resolve the path (in the call to Response.Redirect) so that it works on both your dev box and your deployed web site
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900