I want to include "Remember Me" functionality on login page but I don't know its actual meaning (how its work). I have seen different uses at many websites but I didn't get its actual meaning.
-
1Have a look at this SO question "Form based authentication for websites" stackoverflow.com/questions/549/…– AdrianCommented Aug 7, 2014 at 13:28
-
1And this one "What is the best way to implement "remember me" for a website?" stackoverflow.com/questions/244882/…– AdrianCommented Aug 7, 2014 at 13:31
-
Okay I seen but why are you down voted to this question?. I have search and found no result so what i do? And I have seen many places where remember me used as different then you have answered that why I asked the question.– Naresh RamoliyaCommented Aug 7, 2014 at 13:35
-
Also interesting reading: security.stackexchange.com/questions/44/…– WtowerCommented Feb 24, 2023 at 12:04
3 Answers
Some web applications may need a "Remember Me" functionality. This means that, after a user login, user will have access from same machine to all its data even after session expired. This access will be possible until user does a logout.
From here Using Cookies to implement a RememberMe functionality
It means you save a cookie (or any other local storage option) with some kind of identifiable information about the user.
For more information you can search in the internet for simple implementations of user authentication platforms using PHP, ASP, JSP or any other Server-Side programming language. (Depends on what you know)
With ASP.NET Core this functionality sets the login cookie persistence so it is either cleared when the browser closes or it is retained. This is a very specific thing.
If a user ticks "remember me", then closes and later re-opens their browser, they will be still be logged in if the server didn't otherwise time-out the session.
You can see clearly in the sample code that the "remember me" checkbox sets a parameter in a call to PasswordSignInAsync() named "isPersistent". Documentation shows "persistence" sets the Expires value of the login cookie to "Session" if you do not tick the "remember me" box, or now plus 7 days (the default) if you tick it. I've tested this just now and it's precisely how this behaves.