Is there an API to clear anonymous cookie?
A:
I'm not sure if this is what you are asking, but you can clear all cookies sent to browser as follows:
Response.Cookies.Clear();
If you are having authentication problems, you may want to clarify the question.
HectorMac
2009-02-17 12:46:34
+3
A:
Yes!
System.Web.Security.AnonymousIdentificationModule.ClearAnonymousIdentifier()
See this useful article : (Migrating Anonymous User Settings)
Also Best way to Migrate Anonymous Profile stackoverflow question.
Simon_Weaver
2009-10-24 22:49:46
note: as far as i can tell the two can coexist just fine - so you may not want to remove it. don't just assume that you need to remove it just because you've logged someone in. you can even link the two profiles on the back end - nobody can tell this from client side but it may be useful to track users.
Simon_Weaver
2009-12-08 23:24:30
update: I've changed my mind on this somewhat. it seems that Profile_MigrateAnonymous fires not just when a user logs in - but in the presence of both an anonymous and authenticated cookie. my other question may be of interest http://stackoverflow.com/questions/1895266/can-anonymous-and-authenticated-profiles-coexist-together-in-asp-net
Simon_Weaver
2009-12-13 01:15:29