If you use standard membership providers and forms authentication:
FormsAuthentication.SignOut(); HttpContext.Current.Session.Abandon();
Usually works with pleasure.
Keep in mind that if the user clicks back in their browser, they are likely to see the cached (registered) version.
Change response to comment
I got the impression that FormsAuthentication.Signout :
Removes a forms authentication ticket from the browser.
And that, since the authentication ticket is completely separate from it and is not connected with the session token, if you want to completely clear all user knowledge from the server at this moment, calling Session.Abandon is good. I know that a new session will be created for them in the next page request - I would be interested to see the documentation about the opposite.
Zhaph - Ben Duguid
source share