Do I need to add a new column to a table in MySQL, where all user information is stored, etc.?
Not necessary. Remember Me works by storing in a cookie either the user's basic credentials (his username and password, usually), or temporary credentials that expire after a while. If you use these temporary surrogate credentials, which are usually long random strings, you should add a table to your database where you store them, the username associated with them, and the time they expire.
You almost certainly don't want these credentials sent over an unencrypted connection. You must store them in secure cookies, i.e. cookies that are sent only via HTTPS (you must also set cookies through an unencrypted connection).
If you decide to use a secure cookie, but do not want to encrypt all traffic, you can use two cookies:
- An insecure cookie that only signals the server that you have a secure cookie with credentials.
- A secure cookie with the credentials themselves.
Then, when a user visits your site and is not logged in, you check for an insecure cookie. If it exists, you are redirecting the user to the HTTPS page. Because it is secure, a secure cookie with user credentials is sent by the client. Then proceed to checking the contents of the cookie with the user stored in the database and logging in.
source share