PHP 매뉴얼
이전 |  | 다음

# session_destroy

(PHP 4 , PHP 5)

session_destroy -- Destroys all data registered to a session

## Description

bool session_destroy ( void )

session_destroy() destroys all of the data associated with the current session. It does not unset any of the global variables associated with the session, or unset the session cookie.

This function returns `TRUE` on success and `FALSE` on failure to destroy the session data.

예 1. Destroying a session

`<?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_unset(); // Finally, destroy the session. session_destroy(); ?>`

예 2. Destroying a session with $_SESSION

`<?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(); // Finally, destroy the session. session_destroy(); ?>`

이전 | 처음으로 | 다음
session_decode | 위로 | session_encode