Cookie and Session. Http is a stateless connection. to track user behavior, there must be a variable that works different from the page, cookie and session can be used in PHP. The co http protocol is a stateless connection. to track user behavior, there must be a variable that works different from the page, cookie and session can be used in PHP.
Cookie is familiar to everyone, that is, saving the variable as a file on the client. However, if the customer disables the cookie, there is no way. This requires the session. in PHP4, the session can be implemented in two ways. one is to use cookies, that is, to save the sessionID in the cookie file; the second is to attach sessionID to the URL for transmission.
Although these two methods are implemented, PHP automatically checks the client's cookie settings (linux/unix platform, Win32 unknown) as to which method is used without the worry of programmers ), by default, cookies are used preferentially (you can modify php. session in the [session] section of the INI file. use_cookies ). You can also use a URL to transmit the SessionID as follows:
"> Submit a form
Add only one sentence in the link That's all, right? In php. ini also has many Session settings, such as session. cookie_lifetime is the effective time of the session. it is all in the [session] section. if you look at it, you will have a better understanding of the session in PHP.
Bytes. Co...