Cookies
Setcookie function
Add a cookie
I. ($name, $value, $expire, $path, $domain);
II. $NAME: The name of the cookie
Iii. $value: The value of the cookie
Iv$expire: When the cookie expires, the cookie is automatically deleted
Delete Cookies
Let the cookie file expire
$path: There is a setting on the path, for example, set to the current path, meaning that the server only has the current path of the. php file to read the cookie
$domain: A valid domain name, which is valid only under that domain name (can be accessed)
There is no output before Setcookie in PHP (Echo)
Modify Cookies
Re-set Cookies
If the path is not given, then the current path is set, and if time is not given, the default browser is automatically destroyed when it is closed.
Querying cookies
Use $_cookie[cookie name]
Session
1. What is a session?
A) a conversational technique
b) A file stored in the server that holds the previously accessed information
c) The session query is based on the SessionID number
The principle of 2.Session
A) When the user first visits the server, the login information is stored in a session file on the server, and a SessionID number is generated, and a request is sent to the client browser to produce a cookie file. Store the SessionID number in the cookie, the second time the user came to visit the server, with a cookie with the SessionID number to access the server, the server according to the cookie SessionID number to find the corresponding session file,
c) The session query is based on the SessionID number
Operation of 3.Session:
A) Add sesion
b) Delete session
C) Modify session
d) Query session
Cookie and session (PHP for example)