실제로 사용자를 로그 아웃하려면 세션 ID와 클라이언트에 세션 ID를 전파하는 데 사용되는 쿠키도 해제해야합니다. 이 단순히 캐싱 문제가되지 않습니다
<?php
// Initialize the session.
// If you are using session_name("something"), don't forget it now!
session_start();
// Unset all of the session variables.
$_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 (ini_get("session.use_cookies")) {
$params = session_get_cookie_params();
setcookie(session_name(), '', time() - 42000,
$params["path"], $params["domain"],
$params["secure"], $params["httponly"]
);
}
// Finally, destroy the session.
session_destroy();
당신에게 확신 : 여기
는 것을 수행하는 PHP 설명서에서 샘플 코드? 새로 고침을 클릭하면 로그 아웃 됨으로 표시되므로이 문제가 의심됩니다. – Bradsession_unset을 호출하기 전에 session_start()를 호출합니까? – Gerben
브래드 - 그럼 어떻게해야합니까? Gerben - 예, 있습니다. – Nimi