Example #1
0
 /**
  * 退出登录
  * 
  * @param Request $request
  * @param Response $response
  */
 public function logout(Request $request, Response $response)
 {
     // Unset all of the session variables.
     session_destroy();
     $_SESSION = array();
     // If it's desired to kill the session, also delete the session cookie.
     // Note: This will destroy the session, and not just the session data!
     if (isset($_COOKIE[session_name()])) {
         Cookie::raw_remove(session_name());
     }
     // Finally, destroy the session.
     SIMPHP::$session->anonymous_user($GLOBALS['user']);
     // Reload current pag
     $response->reload();
 }