/** * Sets the session ID. * * @param string $id * @static */ public static function setId($id) { return \Illuminate\Session\Store::setId($id); }
protected function createStorage($sessionId = null) { if ($sessionId !== null) { // $name = '/Google_Client'; // $path = session_save_path().'/'.$name; $name = 'Recca0120Socialite'; $path = sys_get_temp_dir() . '/' . $name; $sessionId = sha1(serialize($sessionId)); $file = new Filesystem(); if ($file->isDirectory($path) === false) { $file->makeDirectory($path, 0755, true); } $handler = new FileSessionHandler($file, $path); $session = new LaravelSession($name, $handler, $sessionId); // $handler = new SymfonyFileHandler($path); // $session = new SymfonySession($handler); $session->setId($sessionId); $session->start(); $this->saveSessionWhenShutdown($session); } else { $session = static::$session; if ($session === null) { $session = $this->request->getSession(); if ($session === null) { if (session_status() == PHP_SESSION_NONE) { $handler = new SymfonyNativeSessionHandler(); } else { $handler = new SymfonyPhpBridgeSessionHandler(); } $session = new SymfonySession($handler); $session->start(); $this->saveSessionWhenShutdown($session); } static::$session = $session; } } $storage = new Storage($session); return $storage; }