PHP会话*并非总是* [英] PHP sessions *not always* working

查看:73
本文介绍了PHP会话*并非总是*的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将一堆网站迁移到了新的VPS,并且在PHP会话方面遇到了很多麻烦.所有网站的配置方式几乎都是相同的,但是有一个网站的会话并不总是有效.让我感到困扰的是它是随机的.我可以登录网站,然后登录,会话将正常进行.然后,一个小时后,我回去,尝试登录相同的帐户,但是它不再保留我的会话了.

I've recently migrated a bunch of websites to a new VPS and I've been having a lot of trouble with PHP sessions. All the websites are pretty much configured the same way, but there is one website where the sessions don't always work. The thing that bugs me is it's kind of random. I can go on the website, log in, and the session will work fine. Then, I go back a hour later, try to log in on the same account, but it doesn't keep my session anymore.

VPS在 CentOS 5.8 上运行,并且具有 PHP 5.4.3 .我要提到的是,在迁移之前,该网站是在PHP 5.3 上运行的.

The VPS is running on CentOS 5.8 and it has PHP 5.4.3. I should mention that before the migration, the website was running on PHP 5.3.

我已经检查了 session.save.path ,这很好.我什至可以看到会话文件(具有正确的用户和所有内容),但是当会话不起作用时它们为空,这是有道理的.但是,为什么有时有时会起作用,有时却没有呢?我在弄清楚这个问题上遇到了麻烦.

I have checked the session.save.path and it is fine. I can even see the session files (with the correct user and everything) but they are empty when the sessions are not working, which makes sense. But why does it sometimes work, and sometimes it doesn't? I'm having trouble figuring this one out.

推荐答案

会话需要保存服务器磁盘空间服务器是否有磁盘空间来保存会话?我们在一个Linux机器上遇到了一个问题,因为该机器的分区磁盘空间不足,因此会话停止保存.

Sessions require server disk space to save has the server got disk space to save the session? we had a problem on a linux box where sessions stopped saving as its partition had run out of disk space.

这篇关于PHP会话*并非总是*的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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