Пример #1
0
 public function logOut($user_session)
 {
     $now = time() + 2;
     //Expire the current session
     if ($stmt = $this->conn->prepare("UPDATE LQ_users\n\t\t\tSET session_expiration = ?\n\t\t\tWHERE session_id = ?")) {
         $stmt->bind_param('ii', $now, $user_session);
         $stmt->execute();
     }
     $this->session->forget();
 }
Пример #2
0
 public function logOut($user_session)
 {
     $now = time() + 1;
     //Expire the current session
     if ($stmt = $this->conn->prepare("UPDATE BBC_users\n\t\t\tSET session_expiration = ?\n\t\t\tWHERE session_id = ?")) {
         $stmt->bind_param('ii', $now, $user_session);
         $stmt->execute();
     }
     $this->session->forget();
     // unset cookies
     if (isset($_SERVER['HTTP_COOKIE'])) {
         $cookies = explode(';', $_SERVER['HTTP_COOKIE']);
         foreach ($cookies as $cookie) {
             $parts = explode('=', $cookie);
             $name = trim($parts[0]);
             setcookie($name, '', time() - 1000);
             setcookie($name, '', time() - 1000, '/');
         }
     }
 }