asp.net.aspxauth

.ASPXAUTH exprires so soon


I have these on my web.config of my root directory

<authentication mode="Forms">
<forms loginUrl="Login.aspx"
       protection="All"
       timeout="60"
       name=".ASPXAUTH" 
       path="/"
       requireSSL="false"
       slidingExpiration="true"
       defaultUrl="default.aspx"
       cookieless="UseDeviceProfile"
       enableCrossAppRedirects="false" />
</authentication>

But .ASPXAUTH cleared so soon (5 minutes I guess).

What is the probable reason?


Solution

  • Very often, it is because you rebuild the solution. The web server restarts and machineKey are regenerated.

    So the cookie encrypted and signed by previous machineKey is invalid.

    That's why you are forced to log out.

    Here is a quick one for you. https://stackoverflow.com/a/436053/280970