Home  >  Article  >  Backend Development  >  Analysis of the difference between session_unset and session_destroy in darkest of days PHP

Analysis of the difference between session_unset and session_destroy in darkest of days PHP

WBOY
WBOYOriginal
2016-07-29 08:45:34856browse

session_unset()
Release all $_SESSION variables currently created in memory, but do not delete the session file and do not release the corresponding session
id
session_destroy()
Delete the session file corresponding to the current user and release the session
id, in memory The contents of the $_SESSION variable are still retained. Therefore, to release all resources of the user's session, the following code needs to be executed sequentially:

Copy the code The code is as follows:

$_SESSION['user'] = 'lowell';
session_unset();
session_destroy();
?>

The above introduces the analysis of the difference between session_unset and session_destroy in darkest of days php, including the content of darkest of days. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn