본문 바로가기
  • 행복하게 오래오래 개발자로 살아가기
Old/PHP

세션 종료

by yundev 2014. 2. 4.
반응형
<?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();
?>
출처 : http://stackoverflow.com/questions/18710946/ending-phpsessid-cookie-sessions


반응형

'Old > PHP' 카테고리의 다른 글

글번호 구하기  (0) 2014.03.10
4단 셀렉트 박스  (0) 2014.02.10
FTP 사이트 만들기  (0) 2013.12.27
GET으로 값을 넘길 때 한글 깨짐  (0) 2013.12.18
실명인증  (0) 2013.12.15