Home > Backend Development > PHP Tutorial > 为什么PHP开启了SESSION,而且也向SESSION写入数据了,sessionid()函数无法获取值?

为什么PHP开启了SESSION,而且也向SESSION写入数据了,sessionid()函数无法获取值?

WBOY
Release: 2016-06-06 20:31:24
Original
1120 people have browsed it

为什么PHP开启了SESSION,而且也向SESSION写入数据了,sessionid()函数无法获取当前回话的SESSIONID值?

回复内容:

为什么PHP开启了SESSION,而且也向SESSION写入数据了,sessionid()函数无法获取当前回话的SESSIONID值?

不知道你想获取什么。var_dump($_SESSION);看看

输出session_id
<?php session_start();echo session_id();

var_dump($_SESSION);打印一下试试,一般出问题就先看具体报什么错,把错误也贴上来也方便解决。

客户端屏蔽了cookie

你使用前调用 session_start(); 了没?

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