Example #1
0
 public static function createTicket($userId)
 {
     /* Remove existing ticket */
     Cookie::delete(static::COOKIE_NAME);
     $ticket = Guid::encrypt(static::getSalt(), join('|', [$userId, Carbon::now()->addMinutes(static::$ticketExpireMinutes)->toW3cString()]));
     Cookie::create(static::COOKIE_NAME, $ticket);
 }
Example #2
0
 public static function set($id, $value)
 {
     $data = [serialize($value), static::getSecret()];
     $data = Guid::encrypt(static::getSecret(), join('|', $data));
     $_SESSION[$id] = $data;
 }