I have an outdated PHP application in the main domain that uses memcache as the backend for our sessions. This works great. I am trying to add a new Zend Framework application to a subdomain that can share the same sessions that are created in the main domain.
I have a session and savehandler utility configured in my application.ini application:
resources.session.saveHandler.class = "App_Session_SaveHandler_Cache" resources.session.saveHandler.options.type = "Libmemcached" resources.session.saveHandler.options.maxlifetime = 300 resources.session.saveHandler.options.front.lifetime = 300 resources.session.saveHandler.options.front.automatic_serialization = true resources.session.saveHandler.options.back.servers.0.host = "127.0.0.1" resources.session.saveHandler.options.back.servers.0.port = 11211 resources.session.saveHandler.options.back.servers.0.persistent = true resources.session.saveHandler.options.back.servers.0.status = true resources.session.saveHandler.options.back.servers.1.host = "127.0.0.2" resources.session.saveHandler.options.back.servers.1.port = 11211 resources.session.saveHandler.options.back.servers.1.persistent = true resources.session.saveHandler.options.back.servers.1.status = true
Session persistence handler class (App_Session_SaveHanlder_Cache implements Zend_Session_SaveHandler_Interface and uses the Zend_Cache factory, passing in the Libmemcached option for internal storage.
In my bootstrap, I have a _init method specified as the first method that causes the session to load:
protected function _initForceSession() { $this->bootstrap('session'); Zend_Session::start(); }
I want to be able to continue to use an existing session from the main domain in my subdomain if it exists, and create a new session if it does not already exist.
I can successfully read the session ID in my new application that was created in an outdated application. However, I cannot get the new application to actually read the session itself.
I tried reading memcache directly from a new application (bypassing the session) and I can thus capture session data.
What am I missing here?
source share