BeetleDev.com
info
contact
Saturday, December 15, 2018
Beetle Blog
ASP.net Membership Login is Logged out after app pool restart
By: douglas - ASP.net - 8/24/2010 1:10:44 AM

 Issue:

Your asp.net application uses the membership and roles provider and users have checked the "remember me" option when logging in that uses a persistent cookie to keep a user logged in.  If the app pool for an asp.net application is recycled the user may become logged out even though the cookie has not expired and still exists.

This issue most often appears in a web farm but can appear in a single server environment.

Cause:

The cookie becomes invalid because the machine key for the application has changed after the app pool recycles.  The machine key is used to read the persistent cookie.  Since it has changed your application can no longer read the cookie and users appear to be logged out.

Solution:

Add a static segment to the web.config.  This will make your application use the same machine key even after an app pool recycle.

Additional Information:

About Machine Key:

http://msdn.microsoft.com/en-us/library/ms998288.aspx#paght000007_machinekeyexplained

Tool for generating a Machine Key for the web.config:

http://aspnetresources.com/tools/machineKey

 


Last Modified: 8/24/2010 1:10:44 AM

Beetle Blog v0.2.2


Copyright © 1997 - 2018 BeetleDev.com. All rights reserved.