From a15c834d12605e737c5a704feca53545337a287a Mon Sep 17 00:00:00 2001 From: Zachary Luna Date: Thu, 17 Jun 2021 15:06:52 -0700 Subject: [PATCH 1/2] Enable Memcache Opt-in to register MemcacheSessionHandler for Sessions --- src/Api/Memcache/MemcacheOptIn.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Api/Memcache/MemcacheOptIn.php b/src/Api/Memcache/MemcacheOptIn.php index d08ded55..8140d486 100644 --- a/src/Api/Memcache/MemcacheOptIn.php +++ b/src/Api/Memcache/MemcacheOptIn.php @@ -52,6 +52,10 @@ class_alias($class, $alias); define('MEMCACHE_HAVE_SESSION', 1); // See ext/session/MemcacheSessionHandler. } + +$handler = new Google\AppEngine\Ext\Session\MemcacheSessionHandler(); +session_set_save_handler($handler, true); + /** * Adds a new item to the cache. Will fail if the key is already present in the * cache. From b1762dbdb72df45e8736dfa6c8e5cf6f7392effe Mon Sep 17 00:00:00 2001 From: Zachary Luna Date: Thu, 17 Jun 2021 16:28:38 -0700 Subject: [PATCH 2/2] add ini_set --- src/Api/Memcache/MemcacheOptIn.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Api/Memcache/MemcacheOptIn.php b/src/Api/Memcache/MemcacheOptIn.php index 8140d486..5cb933d9 100644 --- a/src/Api/Memcache/MemcacheOptIn.php +++ b/src/Api/Memcache/MemcacheOptIn.php @@ -52,9 +52,8 @@ class_alias($class, $alias); define('MEMCACHE_HAVE_SESSION', 1); // See ext/session/MemcacheSessionHandler. } - -$handler = new Google\AppEngine\Ext\Session\MemcacheSessionHandler(); -session_set_save_handler($handler, true); +ini_set('session.save_path', 'Google\AppEngine\Api\Memcache\Memcache'); +session_set_save_handler(new Google\AppEngine\Ext\Session\MemcacheSessionHandler(), true); /** * Adds a new item to the cache. Will fail if the key is already present in the