Search code examples
phppasswordsaccount

How to remember user login on a website


I am trying to create user accounts for my website(To store preferences and data) and I am wondering if anyone could help me with two things.

First, I have looked around a lot, but cannot seem to find any good resources on creating user accounts for a website(all of the web results seem to be about user accounts on a computer or server), so if anyone could suggest a good resource to learn about creating user accounts, that would be great.

Second, what is the best way to remember if a user is logged in? Right now, I have a database that stores users with their emails, passwords and other data. I am wondering how I can check on each page to see who the user is(after they have logged in). Would I use a cookie for this?

If so, how would that work? Would the cookie store their username and password? That does not seem very secure but it is the only way I can think of at the moment.


Solution

  • A google search of PHP User Management Scripts brings out these following results:

    Although you may need to customize each and every one according to your requirements.

    For sure you need to see $_SESSION and $_COOKIE.