$ _ The value assignment fails during the SESSION operation, but the debug single-step debugging is successful. During debug debugging, the following code takes effect. Correct value assignment. However, if the job runs normally in the browser, the assignment fails.
When $ _ SESSION ['active _ Code'] is printed, its value is equal to '3a '. what is the problem? Debugging takes several hours. Debugging is normal. But there is no value for normal operation.
$_SESSION['active_code']['id']=$user_id; $_SESSION['active_code']['name']=$user['user_name']; $_SESSION['active_code']['email']=$user['email'];
Environment: apache + mysql + php5.4.22
Reply to discussion (solution)
How did you print it?
$_SESSION['test']='testvv'; $_SESSION['test']['11']='11testvv'; $_SESSION['active_code']['id']=$user_id; $_SESSION['active_code']['name']=$user['user_name']; $_SESSION['active_code']['email']=$user['email']; $_SESSION['active_code']['key']=$this->md5s($user['email'].$user['passwd']); $this->logs(var_export($_SESSION['active_code'],true)); $this->logs(var_export($_SESSION,true));
Print result:
[14-05-11 13:46:34]: '3a'
[14-05-11 13:46:34]: array (
'Active _ code' => '3a ',
'Test' => 'testvv 1 ',
)
I don't know what is done in your logs method
Directly var_export ($ _ SESSION ['active _ Code ']);
Solution: delete all files in the session directory and resolve the problem.