When the difference between the session cookie and the browser is closed

When the difference between the session cookie and the browser is closed

A cookie is stored locally, cookie when the browser is closed, open whether the value of the previous record again, this time to do with expire the cookie settings.

If the expiration time of the cookie into two

1, a value of 0 or is not set: Open again a browser cookie value is cleared.

2, time () + 30 * 60: to 30 minutes, then turn it on again cookie will not be cleared.

session stored on the server, can be divided again open the case.

Look at the process of the session, in php, session browser with unique value is determined by the cookie,

There are settings in php.ini:

session.name = PHPSESSID // default value PHPSESSID

To determine the value of the session in the browser via PHPSESSID, if the background and record the PHPSESSID cookie expiration time have set, then open the browser again, the value will be recorded.

Otherwise, every time you close your browser, will not open again recorded values ​​will be cleared.

 

Guess you like

Origin www.cnblogs.com/mengzhilva/p/11016566.html