Home > Article > Backend Development > The use of session in PHP_PHP tutorial
1. Initialization (must be used before using session, just use one for each page)
2. Save
$_SESSION[]=;
( can be double, bool, int, array, object type data)
Example:
$_SESSION['']="";
3. Take out the specified
Example:
$uName=$_SESSION[''];
4. Delete the specified
Example:
($_SESSION['']);
5. Delete all sessions (delete the session file corresponding to the current browser)
6. Get session_id
session_id();
SID; //Constant