Session_stater ();
Session control
The HTTP protocol is based on the TCP protocol
HTTP Protocol called Stateless Protocol
Features of the session:
1 stored on the server;
2 Each user will generate a session;
3 There is a default expiration time of about 15 minutes;
4session can store any type of data;
Characteristics of Cookies:
1 stored on the client;
2 Each user will generate a cookie;
3 default does not expire time, but you can set the expiration time yourself;
4 only strings can be stored
SESSION: Security But too high a server requirement;
Cookies: Flexible and insecure
Use of Session
1, the page using session must be opened in the first line of code sesssion
$_session["UID"]= "Zhang San";//Assignment
echo $_session["UID"];
Use of cookies
Setcookie ("UID", "List");//Assignment (Set cookie)
PHP Learning Notes-session control simply introduces session and Cookie