Session_set_save_handler is used to store the session in memcache and then restart the session. The data is not read. When the session contains a file, you can read the data when you call session_start () again. But it is not read in memcache (of course, from... session_set_save_handler is used to store the session in memcache
Then I want to restart the session and find that the data is not read.
When the session contains a file, you can read the data when you call session_start () again.
But it is not read in memcache (of course it can be obtained from memcache)
Question 1: Can I read session data in memcache by reusing existing sessions?
Question 2: How does session_start () load data when reusing existing sessions?
Reply content:
Session_set_save_handler is used to store the session in memcache.
Then I want to restart the session and find that the data is not read.
When the session contains a file, you can read the data when you call session_start () again.
But it is not read in memcache (of course it can be obtained from memcache)
Question 1: Can I read session data in memcache by reusing existing sessions?
Question 2: How does session_start () load data when reusing existing sessions?
Session_start () creates a new session or reuse an existing session. If the session ID is submitted by using the GET or POST method or using the cookie, the existing session will be reused.
Http://php.net/manual/zh/function.session-start.php
The simplest method should be that php. ini can be set directly.
Method I: global settings in php. ini
session.save_handler = memcachesession.save_path = "tcp://127.0.0.1:11211"
Method II:. htaccess in a directory:
php_value session.save_handler "memcache"php_value session.save_path "tcp://127.0.0.1:11211"
Method III: or in an application:
ini_set("session.save_handler", "memcache");ini_set("session.save_path", "tcp://127.0.0.1:11211");
I guess there is a problem with the code writing.