首页 > php会话 > Warning: session_destroy() [function.session-destroy]: Trying to destroy

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

在使用session_destroy(),进行Session变量的注销时,出现了:Warning: session_destroy() [function.session-destroy]: Trying to destroy uninitialized session in 的错误.

经查证,在进行使用session_destroy()函数必须先调用session_start()函数,也就是要有如下代码:session_start();session_destroy();

分析:还是经验不足啊,对session的理解不足,出现了这个错误,后来查了一下,在调用session_destroy()之前,需要调用 session_start();来告诉系统你当前是有session的。然后再去关闭.

教程地址:https://www.phprm.com/huihua/fs613.html

欢迎转载!但请带上文章地址^^

标签:function session_destroy() destroy

相关文章

发表留言