Base solution for your next web application
Open Closed

Login Remember Me #3975


User avatar
0
devkev2403 created

Hi,

how exactly should the "Remember Me" checkbox on the login page work?

Currently I use a cookie so ticking or unticking the checkbox makes no difference. If the user does not explicitly logout, the next time they open their browser they are automatically logged in. This is not what I want.

Thanks


2 Answer(s)
  • User Avatar
    0
    aaron created
    Support Team

    ABP (and ASP.NET Zero) uses Microsoft.AspNetCore.Http.Authentication's AuthenticationManager.SignInAsync method and AuthenticationProperties.IsPersistent property.

    See this explanation on Stack Overflow:

    Persistent cookies will be saved as files in the browser folders until they either expire or manually deleted. This will cause the cookie to persist even if you close the browser.

    If IsPersistent is set to false, the browser will acquire session cookie which gets cleared when the browser is closed.

    Now the reason session cookie wont clear after restarting the browser is because of chrome default settings. To fix it go to chrome settings -> advanced, and uncheck Continue running background apps when Google Chrome is closed under System section.

  • User Avatar
    0
    devkev2403 created

    Hi Aaron, that was exactly the information I was looking for! Thank you.