public function initSession() { $config = App::conf('app', 'session', array()); $session = new Session(); if (isset($config['type'])) { switch ($config['type']) { case 'file': if (!empty($config['file']['save_path'])) { $session->setSavePath($config['file']['save_path']); } break; case 'memcached': $session->setHandler(new Memcached($config['memcached']['servers'])); break; } } $session->start(); return $session; }
public function who() { if ($this->check()) { return Session::pull('authentication')['key']; } return false; }