0

I'm using Sitecore 10.1 with Commerce 10.1 and working on a requirement to keep the website visitor always logged in (even with browser close & system restarts).

I have used the default SXA login method which accepts "Remember Me" as a parameter.

The default timeout setting is:

<setting name="Authentication.ClientPersistentLoginDuration" value="180"/>

But the end user still got logged out after a while when reopening the browser.

I have now changed the default value "00:30:00" to "3650:00:00:00" (10 years).

<processor name="CookieAuthentication" type="Sitecore.Owin.Authentication.Pipelines.Initialize.CookieAuthentication, Sitecore.Owin.Authentication" resolve="true" patch:source="Sitecore.Owin.Authentication.config">    
<ExpireTimeSpan>3650:00:00:00</ExpireTimeSpan>
<SlidingExpiration>true</SlidingExpiration>
<CookieSameSite>None</CookieSameSite>
</processor>

Is this the right way to do this.

2
  • 1
    I am not sure about above method is right way of doing but instead you can set a custom property to Customer profile after login and whenever you close the browser and open it again, you can check if that custom property is set then do automatic login. Apr 22 at 8:46
  • 1
    @Qwerty Have you checked the accepted answer in this similar question already? sitecore.stackexchange.com/questions/25007/… Apr 22 at 14:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.