Session management is an important part of web development, including Session and Cookie technologies.
1. How Cookie works
setcookie()
2. Cookie application development
Can only read the domain
A single domain cannot exceed 20 cookies. The maximum length of each cookie file is 4k bytes. The browser can store up to 300 cookies
6 attributes: name, value, expires, path, domain, secure
Save form content
Control access authorization
3. Write a general Cookie class
4. Solution
Cookie access optimization
You can save a series of cookie data into an array
Detect whether the client supports
Try to set a cookie on the first run and then call
Second-level domain name implementation
setcookie( name , value ,expires ,path ,'domain.com‘,secure )
Cookie security
Cookie restrictions
5. Session concept
6. Session configuration
7. Session application
Create
Modify
View current sessionid
Change expiration time session.cookie_lifetime
Destroy the current session
8. Session encoding and decoding
session_encode()
session_decode()
9. Save array in session
10. Save objects in session
11. Session access optimization
12. Sharing sessions on multiple servers (important)
13. Session security
http://www.bkjia.com/PHPjc/477689.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/477689.htmlTechArticleSession management is an important part of web development, including Session and Cookie technologies. 1. Cookie working principle setcookie() 2. Cookie application development can only read the domain where it is located. A single domain cannot exceed...