Home >php教程 >php手册 >PHP session destroyed / lost after header

PHP session destroyed / lost after header

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 19:57:161033browse

在header重定向后,注册的session居然消失了?! 找到解决办法: After the Header redirect you need to exit the PHP script: header(Location: /); exit(); 参考:http://stackoverflow.com/questions/2037316/php-session-destroyed-lost-after-header

在header重定向后,注册的session居然消失了?!

找到解决办法:

After the Header redirect you need to exit the PHP script: 

header("Location: /"); 
exit();

参考:http://stackoverflow.com/questions/2037316/php-session-destroyed-lost-after-header

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