/** * Register bindings in the container. * * @return void */ public function register() { $this->app->singleton('cookie', function ($app) { $cookie = new CookieJar($app['encrypter']); $config = $app['config']['session']; return $cookie->setDefaultPathAndDomain($config['path'], $config['domain']); }); }
/** * Load the contents of the client's session into the data array. * * @param array $cookies * * @return array */ protected function load($cookies) { foreach ($_COOKIE as $name => $value) { $cookie = $this->cookie->get($name); if ($cookie instanceof SetCookie) { $cookies[] = $cookie; } } return $cookies; }
/** * Update the session with the given cookie. * * @param string $id * * @return void */ protected function updateSession($id) { $this->cookie->make($this->getName(), $id); }