Answer the question
In order to leave comments, you need to log in
How does the server identify the user with the session id?
I don't quite understand how this happens. For example:
Answer the question
In order to leave comments, you need to log in
The user has a session identifier entered in the cookie (actually, the file name if the sessions are stored in files or the key name if the sessions are stored, for example, in Redis or some other in-memory database).
Whether to use IP for additional identification or some other property of the client is up to the application developer.
When a user sends a request to the server, there is also a cookie with the session ID in the request headers, so the server will know who sent the request.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question