Home  >  Article  >  Backend Development  >  Warning: session_destroy() [function.session-destroy]: Tryin_PHP教程

Warning: session_destroy() [function.session-destroy]: Tryin_PHP教程

WBOY
WBOYOriginal
2016-07-13 10:54:55812browse

When using session_destroy() to log out the Session variable,

appeared

Warning: session_destroy() [function.session-destroy]: Trying to destroy
uninitialized session in

’s error! ! After verification, the session_start() function must be called first before using the session_destroy() function.
That is to say, the following code is required:
session_start();
session_destroy();
?>

Analysis

I still lack experience and lack of understanding of sessions. This error occurred, and I checked it later,

Before calling session_destroy(), you need to call session_start();

To tell the system that you currently have a session. Then close

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632282.htmlTechArticleWhen using session_destroy() to log out the Session variable, Warning: session_destroy() [function.session -destroy]: Trying to destroy uninitialized session in error! ! ...
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