If the value of the session is 0, it will be converted to false. page A/* determines whether the SESSION is enabled */& nbsp; & nbsp; if (session_id () & nbsp ;? & Nbs the question of converting the value of 0 to false in the session
Page
/* Determine whether the SESSION is enabled */
If (session_id ()? False: true)
Session_start ();
$ _ SESSION ['uid'] = 0;
$ _ SESSION ['username'] = 'admin ';
Page B
/* Determine whether the SESSION is enabled */
If (session_id ()? False: true)
Session_start ();
Print_r ($ _ SESSION );
Var_dump ($ _ SESSION ['uid']);
Execute page A and then execute page B.
Array ( [uid] => [username] => admin ) bool(false)
The Cookie scope is normal, and the local test does not have cross-domain problems. The session_id and page encoding of the two pages are consistent. On page A, $ _ SESSION ['uid'] is int (0), while on page B is bool (false). This problem is confusing for two days, please kindly advise
------ Solution --------------------
I run your code normally.
------ Solution --------------------
Some frameworks will run session_start on their own. Are there any problems?
------ Solution --------------------
Apparently, your framework judges and processes $ _ SESSION ['uid '].
Since it is a "niche", you can find it slowly.