Try our conversational search powered by Generative AI!

Unable to increase application identity cookie expiring time

Vote:
 

We are working on an upgrade from CMS 11 to CMS 12.

Application identity cookie is expiring within 20-30mins; we are unable to increase expiry time.

Below is the setup we have done in application startup middleware.

  services.AddCmsAspNetIdentity<ApplicationUser>(o =>

            {

                o.ConnectionStringOptions = new ConnectionStringOptions

                {

                    Name = "EPiServerDB",

                    ConnectionString = connectionString

                };

            });

we are increasing the cookie time as shown below, cookie expire time is applying only if we pass IsPersistent as true in AuthenticationProperties in SignInAsync method, actually we set IsPersistent as true based on login remember me.

            services.ConfigureApplicationCookie(options =>

            {

                options.Cookie.HttpOnly = true;

                options.LoginPath = "/";

                options.SlidingExpiration = true;

                 options.ExpireTimeSpan = TimeSpan.FromDays(1);

            });

                                               

Can you please review and provide your thoughts if I am missing something?

#292702
Dec 05, 2022 16:26
Vote:
 

Have you tried increasing the SecurityStampValidation interval e.g:

services.Configure<SecurityStampValidatorOptions>(o => o.ValidationInterval = TimeSpan.FromHours(10));
#292737
Dec 05, 2022 23:44
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.