Home  >  Article  >  Backend Development  >  ajax传值到php页面,存入session。在其他页面调用不到存入的session值

ajax传值到php页面,存入session。在其他页面调用不到存入的session值

WBOY
WBOYOriginal
2016-06-06 20:38:561225browse

有人遇到过这样的现象吗,利用ajax去请求到a.php页面,然后在a.php页面用session存储ajax传过来的值,然后在b.php页面调用session中的值,但是空的

回复内容:

有人遇到过这样的现象吗,利用ajax去请求到a.php页面,然后在a.php页面用session存储ajax传过来的值,然后在b.php页面调用session中的值,但是空的

1、确认下session id 一致
2、确认下session_start开启,并且之前没有任何输出。

看看ajax的header是否带了session_id,没带说明cookie丢失或者跨域了。

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