Home > Backend Development > PHP Tutorial > 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
Release: 2016-07-29 08:45:34
Original
919 people have browsed it

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.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template