Answer: Session operation mechanism:
User A accesses Site y, if site y specifies session_start ();(The following Assumption Session_Start () is always present) then a session_id is generated, and this session_ The ID is usually saved to user A in the form of a cookie (we can force the SessionID to be php.ini by setting the Session.use_only_cookies to 1 in the )。 At this time SessionID performance as $_cookie[' Phpsessid '];(P Hpsessid can be modified by Session_name () function)
User A then accesses, and the session ID ($_cookid[' phpsessid ') is routed to site Y each time a accesses Y.
On site Y, there is a directory that is used to hold the actual data of the session. Site Y receives the SessionID, and then passes the session ID, which is associated with the session data and returns the session data.
Answer: The difference between session and Cookie:
Session stored on the server side, users can not be modified, relatively safe, the cookie is stored in the client, the user through means to modify, relatively insecure.
Sessions are saved on the server for a certain amount of time, and when access is increased, server resources are compared.
The limit for a single cookie on the client is 3k, meaning that a site may not store more than 3k of cookies on the client.
Answer: How many servers share the session:
Sharing is a common one for each server, so it's obvious to put this session in one place
such as the database, each server is tuned in the database session
The same principle as memcache
A: Yes, but it is necessary to write the session_id to the URL when the value is passed, because when the parameter is disabled, it will be sent to the back of the URL in the form of parameters!
Session and Cookie differences, how many Web servers share session, disable cookies after the session is available, why?