Permalink
Browse files

Fix connect redis

  • Loading branch information...
duythien committed Feb 2, 2017
1 parent 0af2b5d commit b24b4e651c241b5cb6bf8600a0930d719923aeea
Showing with 9 additions and 8 deletions.
  1. +1 −1 .env.example
  2. +8 −7 core/common/library/Providers/SessionServiceProvider.php
View
@@ -61,7 +61,7 @@ SESSION_LIFETIME=600
SESSION_UNIQUE_ID=phanbook_
SESSION_PREFIX=forum_
SESSION_INDEX=0
SESSION_DOMAIN=.phanbook.com
SESSION_DOMAIN=null
VIEW_CACHE_DRIVER=File
VIEW_CACHE_LIFETIME=86400
@@ -40,16 +40,17 @@ public function register()
$this->serviceName,
function () {
/** @var \Phalcon\DiInterface $this */
$config = $this->getShared('config');
$config = $this->getShared('config')->application->session;
if (isset($config->application->session->adapter)) {
$sessionAdapter = '\Phalcon\Session\Adapter\\' . $config->application->session->adapter;
if (isset($config->adapter)) {
$sessionAdapter = '\Phalcon\Session\Adapter\\' . $config->adapter;
if (class_exists($sessionAdapter)) {
$config = $config->application->session->toArray();
unset($config['adapter']);
if (isset($config->domain)) {
ini_set('session.cookie_domain', $config->domain);
}
$options = $config->options->toArray();
/** @var \Phalcon\Session\AdapterInterface $session */
$session = new $sessionAdapter($config);
$session = new $sessionAdapter($options);
$session->start();
return $session;

0 comments on commit b24b4e6

Please sign in to comment.