on the client side, nothing is safe.
You can easily change the login flag for cookies in any browser. Thus, it is more recommended to save the registration data to php $ _SESSION
If you want to extend the session, just look at session_set_cookie_params() .
By default, the same session will be used for the current domain and all paths in this domain. Thus, it reads for both blahblahblah.com/ and blahblahblah.com/login/
When a user logs in, save the username and password hash in the session.
At the beginning of each script, check the username and password of the session with the name in the database. If this is correct, set a flag (for example, $ userLoggedIn = true) to indicate on the server side that the user is logged in. Else false.
mauris
source share