One, session control
- In order for the Web site to track the interaction between the client and the server, to save and remember each user's identity and information, we need a powerful solution that generates session control.
- HTTP is a stateless protocol that cannot be maintained to maintain a connection between two transactions.
- When a user requests a page and then requests another page, HTTP cannot tell us that the two requests came from the same person.
- The idea of session control is to be able to track a variable in the Web site, we can track the variables, we can do the user support, and according to the authorization and user identity display different content, different pages.
second, what is a cookie?
- A cookie is a way for a server or script to maintain client information under the HTTP protocol.
- A cookie is a cookies (a small text file) that a Web server holds on a user's browser and can contain information about a user, often used to save usernames, passwords, personalization settings, personal preferences, and so on.
- When a user accesses a server, the server can set and access cookie information.
- Cookies are stored on the client, usually in the cookie Temp folder of IE or Firefox browser, and can be deleted manually.
- Cookies are transmitted using the HTTP header information in the Code of the Web page, and each page request from the browser can be accompanied by a cookie.
- Note: If there is too much cookie on the browser, the browser will automatically delete it if it exceeds the range allowed by the system.
third, set the cookie
Iv. receipt and use of cookies
v. Deletion of cookiesTo delete a cookie that already exists,There are two ways .:
- Call the Setcookie with the name parameter only, then the cookie named will be deleted from the client;
- Example:
Setcookie ("MyCookie");
- Set the cookie to expire at time () or 1
Session Tracking Technology--cookie