remove() static public méthode

Remove a cookie
static public remove ( string $key, string $domain = '/' ) : mixed
$key string The name of the cookie
$domain string The domain of the cookie
Résultat mixed true: the cookie has been removed, false: the cookie could not be removed
Exemple #1
0
 public static function logout()
 {
     session_regenerate_id();
     s::remove('auth.created');
     s::remove('auth.updated');
     s::remove('auth.key');
     s::remove('auth.secret');
     s::remove('auth.username');
     s::remove('auth.ip');
     s::remove('auth.ua');
     cookie::remove('key');
 }
Exemple #2
0
 public function logout()
 {
     if ($this->isCurrent()) {
         cookie::remove('key');
     }
     $this->update(array('token' => null));
 }
 public static function unauthorize()
 {
     s::remove('kirby_auth_secret');
     s::remove('kirby_auth_username');
     cookie::remove('kirby_auth');
 }
Exemple #4
0
 /**
  * Destroys a session
  * 
  * <code>
  * 
  * s::start();
  * // do whatever you want with the session now
  * 
  * s::destroy();
  * // everything stored in the session will be deleted
  * 
  * </code>
  *
  */
 public static function destroy()
 {
     if (!static::$started) {
         return false;
     }
     $_SESSION = array();
     cookie::remove(static::$name);
     static::$started = false;
     return session_destroy();
 }