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

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

WBOY
Release: 2016-06-06 20:38:56
Original
1288 people have browsed it

有人遇到过这样的现象吗,利用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丢失或者跨域了。

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