-
Notifications
You must be signed in to change notification settings - Fork 866
Cookie expiration time configured in ConfigureApplicationCookie
ignored by Identity
#1425
Comments
Have you configured your server to store the cookie decryption keys permanently? if not, whenever the server restarts or the app pool restarts, your users will have to login again. |
I went through the documentation and did as mentioned but still i get logged out after 30minutes. |
Can you try changing your code to this? cfg.ExpireTimeSpan = TimeSpan.FromDays(15); As mentioned in the xmldocs, Cookie.Expiration is ignored on CookieAuthenticationOptions. Possible duplicate of https://github.com/aspnet/Security/issues/1293 |
I have done this as well but no luck.@natemcmaster could you give me a reference to code which checks for ticked expiration? |
I found the location in which check for expiration is done and figured out that the problem is ,identity checks every 30 minutes (by default, its configurable) to see if issued authentication ticked is valid, consequently it checks to see if the class which is implementing
and following is getter of
As my |
Ok, thanks for letting us know @B-Esmaili. We'll use aspnet/Security#1293 for further follow up on the Cookie.Expiration vs ExpireTimeSpan discussion. |
I had the same problem. It took me quite some time to find out the cause. Shouldn't addIdentity() check whether the securityStampValidatorStore is supported, and if not, either throw or skip the registration of the validation? |
Sure that's a reasonable suggestion, can you file a new issue asking for that improvement? its something we can consider for 2.2 as it would be very cheap @tiljanssen |
Here is my configuration for identity cookie :
as you can see cookies is generated for 15 days but it expires in almost half an hour.could anyone clarify what is problem with my configuration?
The text was updated successfully, but these errors were encountered: