Link to home
Start Free TrialLog in
Avatar of dodgerfan
dodgerfanFlag for United States of America

asked on

ASP.Net Login/Logout with Forms Authentication issue

I am using Forms Authentication with an ASP.Net website (C#, Visual Studio 2008). If I bring the browser up and login I can get in. When I click the Logout link it goes to the correct page, but if I then try to login again as a different user, I am logged in as the previous user. It seems to be storing the user info and continuing to use it. The only way to log in as a different user is to close the browser and open it again. Any idea how to fix this issue?
Avatar of Bill Nolan
Bill Nolan
Flag of United States of America image

Are doing something unusual?  E.g.:

1) Are your login controls in an UpdatePanel?
2) Have you disabled ViewState?
3) Have you messed with the browser cookies?
SOLUTION
Avatar of Alfred A.
Alfred A.
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dodgerfan

ASKER

All of the comments had me working through the code to get it working. I was looking in the wrong section. Some redundant stuff I thought I had removed. Once the logout page was redirected to properly, it worked correctly. The On_load event of the logout page runs the Forms.Autrhentication.SignOut(), plus I put session.abandon in it and finishing it by re-directing back to my main page with the user logged out. I've tested it repeatedly and it's working right. Thanks for all of the ideas, they all got me looking in the right area. I'm going to try and divide up the points.
All of these comments/suggestions helped me find the solution.