【发布时间】:2010-10-21 12:32:32
【问题描述】:
这些是我在 index.php 中的前 5 行:
<?php
session_start();
if (!isset($_SESSION['cart'])) $_SESSION['cart']='';
$page = $_GET['page'];
?>
等等.. 我正在通过 firefox->firebug->firecookie 插件查看会话,并且没有创建会话。(我确信这一点,因为昨天工作的购物车今天不能工作。) 任何想法为什么会发生这种情况以及如何解决它?
我在启用错误时发现了这一点: 警告:session_start() [function.session-start]:无法发送会话 cookie - 标头已由 /home/controll/public_html 中的(输出开始于 /home/controll/public_html/metalkonsult.com/index.php:1)发送/metalkonsult.com/index.php 在第 2 行
我进一步探索 - 一些东西被发送到浏览器,但我不知道它来自哪里。我做了一个 var_dump(headers_list());在第一行,这就是我得到的:
array(2) { [0]=> string(23) "X-Powered-By: PHP/5.2.6" [1]=> string(23) "Content-type: text/html" }
如何关闭此功能?是什么寄来的?
我设置 session.auto_start = 1 在网站文件夹中的 php.ini 中 会议现在工作.. 不知道是什么原因造成的,但问题暂时解决了
【问题讨论】: