Search code examples
asp.netasp.net-mvccookiesprofilemembership

.ASPXAUTH and .ASPXANONYMOUS are getting deleted in debug environment


I am debugging my project at my local machine. I am storing information in two default cookies .ASPXAUTH and .ASPXANONYMOUS. However, I realise they are deleted everytime when I stop debugging. So SQL server can never match up the previous profile settings.

I read this link it says these cookies are only working when you get a real IP address.I do not have a .net+SQL server that I can use for upload testing. Question is, can I preserve the cookies or somehow make it work in my local machine? Thanks

<authentication mode="Forms">
  <forms name=".ASPXAUTH" defaultUrl="~/Home/Index" loginUrl="~/Account/LogOn"
         protection="All" cookieless="AutoDetect" slidingExpiration="true" timeout="8760" />
</authentication>

<anonymousIdentification cookieName=".ASPXANONYMOUS" cookieProtection="All" cookieless="AutoDetect"
         enabled="true" cookieSlidingExpiration="true" cookieTimeout="8760" />

EDIT: To get an idea of the problem please see this pic below. Instead of just keep using first row as UserId, the .NET membership keeps creating new entry everytime when I stop/start a new debugging. Reason is the old cookies in last session was deleted as soon as debugging was stopped.

enter image description here


Solution

  • Have you tried to verify if the delete browsing history is not checked fro your internet options. If that`s checked, it might be deleting the cookies.