Question Removing/Deleting the Forms Authentication Cookie

njsokalski

Well-known member
Joined
Mar 16, 2011
Messages
102
Programming Experience
5-10
I have a Web Application that uses ASP.NET Membership. When the user logs out, I want the Forms Authentication cookie to be removed from the browser. This is basically automatic when the user did not select the Remember Me checkbox (because a session cookie is created in that case), but if they login with the Remember Me checkbox checked, the Forms Authentication cookie does not get removed when they logout (because it is a persistent cookie), therefore they are automatically logged in next time, which is not the way it should be, since they logged out last time. This is obviously because a persistent cookie is created when they login with the Remember Me checkbox checked. I have tried everything I could find or think of to manually delete the Forms Authentication cookie (I put this code in the event handler for either the LoggingOut or LoggedOut event of the LoginStatus control). What am I doing wrong, and what code should I be using to get rid of the Forms Authentication cookie? Thanks.
 
Back
Top