stop() public méthode

first, connect to a database containing the sessions table include the class require 'path/to/Zebra_Session.php'; start the session where $link is a connection link returned by mysqli_connect $session = new Zebra_Session($link, 'sEcUr1tY_c0dE'); end current session $session->stop();
Since: 1.0.1 @return void
public stop ( ) : void
Résultat void
Exemple #1
0
 /**
  * logout by destroying the session
  */
 public static function logout()
 {
     if (!self::$testMode) {
         // This is handled by cascading delete in database schema
         // This way if the GC deletes the session the event subscriptions will
         // be cleaned up
         // $userId = self::getUserId();
         // if (isset($userId))
         // {
         // // Unsubscribe from all events
         // $pdo = new EventServicePDO();
         // $pdo->unsubscribeForUser($userId);
         // }
         /*
          * NO_ZEBRA_SESSION $_SESSION = array(); // destroy all of the session
          * variables session_destroy();
          */
         $link = mysqliConnect();
         $session = new Zebra_Session($link, SESSION_HASH, SESSION_LIFETIME_SECONDS);
         $session->stop();
         self::$xactSession = NULL;
     }
 }