Php stores sessions in memcache

Source: Internet
Author: User
Since php stores sessions to memcache, it requires cross-top-level domain names, so I want to save the sessions to memcache, so I made the following settings: ini_set (session. save_handler, & nbsp; memcache); & nbsp; ini_set (session. save_path, & nbsp; tcp: 192.168.0.77: 112 php stores session in memcache
Because cross-top-level domain names are required, I want to save the session to memcache,
So we made the following settings:
Ini_set ("session. save_handler", "memcache ");
Ini_set ("session. save_path", "tcp: // 192.168.0.77: 11200 ");

Error: A session is active. You cannot change the session module's ini settings.

If it is set as follows: session. auto_start = 0
The session can be normally stored in memcache.

However, the sessionid value changes every time the page is refreshed, so the previously saved value cannot be obtained,

Set the value of session. auto_start to 1. the value of sessionid remains the same every time the page is refreshed, but the value is not saved.

How can this problem be solved?


------ Solution --------------------
Session_start ();
Run the following command after ini_set ("sessio...

When session. auto_start = 1, php implicitly calls session_start () before the script is executed ()
Of course, this cannot meet your needs.
------ Solution --------------------
Upstairs, can you use encrypted cookies to implement your cross-top-level domain names? try another way.
------ Solution --------------------
Refer to ucenter
------ Solution --------------------
Pass the sessionid value and use the session_id function to specify the sessionid value.

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.