Example #1
0
 /**
  * Mengecek apakah token yang dikirimkan sama dengan token yang disimpan di session.
  *
  * @return string $token
  * @return bool
  */
 public static function match($token)
 {
     $token_name = Config::get('session.token_name');
     if (Session::exists($token_name) && $token === Session::get($token_name)) {
         Session::delete($token_name);
         return true;
     }
     return false;
 }
Example #2
0
 public static function user()
 {
     return self::check() ? Session::get(Config::get('session.name')) : false;
 }
Example #3
0
 public static function is_connected($user)
 {
     return Session::get($user);
 }