Example #1
0
 /**
  * Load a session from storage by a given ID.
  *
  * If no session is found for the ID, null will be returned.
  *
  * @param  string  $id
  * @return array
  */
 public function load($id)
 {
     if (\Laravel\Cookie::has(Cookie::payload)) {
         $cookie = Crypter::decrypt(\Laravel\Cookie::get(Cookie::payload));
         return unserialize($cookie);
     }
 }
Example #2
0
 /**
  * Test Cookie::has method.
  *
  * @group laravel
  */
 public function testHasMethodIndicatesIfCookieInSet()
 {
     Cookie::$jar['foo'] = array('value' => Cookie::hash('bar') . '+bar');
     $this->assertTrue(Cookie::has('foo'));
     $this->assertFalse(Cookie::has('bar'));
     Cookie::put('baz', 'foo');
     $this->assertTrue(Cookie::has('baz'));
 }
Example #3
0
 /**
  * Load a session from storage by a given ID.
  *
  * If no session is found for the ID, null will be returned.
  *
  * @param  string  $id
  * @return array
  */
 public function load($id)
 {
     if (C::has(Cookie::payload)) {
         return unserialize(Crypter::decrypt(C::get(Cookie::payload)));
     }
 }