Correct way to "remember me"

I hope I misunderstood that whole sentence, because, wIth a “remember me” system, there is no “further login”. Should the “remember me” cookie be available and valid, then the user is logged in automatically through the cookie. That is the whole idea of having that system. :smile: So, the sentence should read:

Upon entering a page usually needing a login, if the user has a remember me cookie available and its token can be used to authenticate the user, then the user is automatically logged in. If the cookie is expired, the user must login in again and if the “remember me” check box is checked, then a new “remember me” cookie is set.

:wink:

Did you decide to throw OOP out the window? Or is that just a snippet of a class? :smiley:

If I may make a similar suggestion to what someone else made. Put up a popular and modern framework of your choice next to your own work and reference to it. Try out your code/ methods and when you say, now I am stuck or now I am finished, dig into the framework and its documentation to see how they solved the same problem, because 99% of the time it is an accepted and correct way to solve the problem. Doing that will certainly give you a “push” in the right direction for sure, if you are stuck and will show you for sure, how you went wrong, if you went wrong, when you are finished.

You might also find decent books on the subject too. Like one I had the pleasure of working on.

This book goes into great detail about the Symfony security systems and you’ll learn quickly, user login and remember me cookies are just a small part of the bigger web application picture (and why frameworks are so valuable), when it comes to security.

Edit: I just realized, the suggestion to use a framework was made in another one of your topics.

Scott

1 Like