/**
  * 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;
 }
Example #2
0
 /**
  * Get the id for the currently authenticated user.
  *
  * @return int|null
  */
 public function id()
 {
     if ($this->loggedOut) {
         return;
     }
     $id = $this->cookie->get($this->getName());
     if (is_null($id) && $this->user()) {
         $id = $this->user()->getAuthIdentifier();
     }
     return $id;
 }