为什么PHP会话被破坏? [英] Why PHP Session Destroyed?

查看:51
本文介绍了为什么PHP会话被破坏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个php代码,

<?php

session_start();
Print_r($_SESSION);
$_SESSION['value'] = 1;
Print_r($_SESSION);

?>

为什么每次我刷新页面时都打印以下内容.

Why it Prints following, everytime when I refreshes the page..

Array
(
)
Array
(
    [value] => 1
)

它应该打印,

Array
(
    [value] => 1
)
Array
(
    [value] => 1
)

我正在将lighttpd用作Fedora 14上的http服务器.

I am using lighttpd as http Server on Fedora 14.

推荐答案

我了解到,运行chown -R root:lighttpd /var/lib/php/可以解决其他存在相同问题的问题.

I read that running chown -R root:lighttpd /var/lib/php/ fixed the problem for others that were having the same issue.

来源:
http://masdeni.com/archives/6-Lighttpd-+ -PHP-Session-Problem.html

这篇关于为什么PHP会话被破坏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆