$ _ The value assignment fails during the SESSION operation, but the debug single-step debugging is successful.

Source: Internet
Author: User
$ _ 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.