Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

when I set two session service in serices(DI), Will it work in two name?

        >

//设置memcache session缓存 $di->set('session', function(){ $memcache = new Phalcon\Session\Adapter\Memcache(array( 'uniqueId' => 'm1', 'host' => '127.0.0.1', 'port' => 11211, 'lifetime' => 1200, // 1200 20分钟 'prefix' => 'xxf', 'persistent' => true )); $memcache->start(); return $memcache; });

//设置memcache session缓存 $di->set('smssession', function(){ $memcache = new Phalcon\Session\Adapter\Memcache(array( 'uniqueId' => 'msms', 'host' => '127.0.0.1', 'port' => 11211, 'lifetime' => 300, // 300 5分钟 'prefix' => 'xxf', 'persistent' => false )); $memcache->start(); return $memcache; });

will session and smssession work ? but my smssession seems donest work , lifttime is not 300.



3.2k
Accepted
answer

If you try use another port for second instance?



13.0k

I dont know but I want to use two session different lifetime, how to do this?