If the value of the session is 0, the problem A page * determines whether the SESSION is enabled * & nbsp; & nbsp; if (session_id () & nbsp ;? & Nbsp; false & nbsp;: & nbsp; true) & nbsp; & if the value of 0 in the session is set to false
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.