Hi all,
I'm have some troubles with redis session when I'm trying to destroy it.
Configuration (Virtualbox with 4 VM) :
HTTP Server
- nginx v1.10.2
- PHP Version 7.0.13-1~dotdeb+8.1
- Phalcon 3.0.2
Cache Server
- Redis v3.2.5
Session Server
- Redis v3.2.5
Databases Server
- MariaDB
- MongoDB
Bootstrap cache setting :
$cacheConfig = new Config( require ($this->servicesDir . 'cache.php'));
$this->di->set('cache', function () use ($cacheConfig) {
$frontCache = new \Phalcon\Cache\Frontend\Data(
[
'lifetime' => $cacheConfig->lifetime
]
);
$cache = new \Phalcon\Cache\Backend\Redis($frontCache, $cacheConfig->redis->toArray());
return $cache;
});
Redis cache server works perfectly with cache settings (maxmemory ans momemry-policy) and AUTH.
Then i'm using session with another redis server (normal settings), I try using session but it's seems when i'm using destroy function, it doesn't work...
Bootstrap session setting :
$cacheConfig = new Config( require ($this->servicesDir . 'session.php'));
$this->di->set('session', function () use ($cacheConfig) {
$session = new \Phalcon\Session\Adapter\Redis($cacheConfig->toArray());
$session->start();
return $session;
});
Test used :
$this->session->set('foo', 'Bar');
echo $this->session->get('foo'); // OK
$this->session->set('product', ['name' => 'ipad', 'price' => '299.90€']);
var_dump($this->session->get('product')); // OK
$this->session->destroy();
echo $this->session->get('foo'); // data not destroyed
var_dump($this->session->get('product')); // data not destroyed
Data not deleted on remote server.
Any Idea why session destroy not work ?
Thx.