Answer the question
In order to leave comments, you need to log in
How do sessions work?
1) Let's say the user entered the login and password, sent it to the server, the server checked for the presence of the user and the match login: pass.
2) If everything is OK, then we generate a random string and write it to cookies. We save the same string to the database, to table X of the form login + string.
3) When updating a page / switching to others, we send cookies with a string to the server and look for a string in table X. If there is such a string, then we identify the user by sending a login corresponding to the string in response.
Does the session system work like this and is such an implementation sufficient or have I missed something?
And if everything is so simple, then why use third-party modules to implement sessions?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question