【发布时间】:2019-04-28 15:21:57
【问题描述】:
我的会话没有保存页面刷新或转到另一个页面。这一切都是在使用 composer update 更新我的所有作曲家文件并将我的 EC2 服务器从 t2.nano 升级到 t2.micro 之后开始发生的。不知道是什么原因造成的?
我已尝试使用此代码来查看我的会话是否正在保存并且它正在保存:
if (!is_writable(session_save_path())) {
echo 'Session path "'.session_save_path().'" is not writable for PHP!';
}
这是我测试我的 SESSION 代码的方式:
<?php
session_start();
$_SESSION['test'] = 'ok'; // 1st time loading the page works. I remove this line on the second refresh and the var_dump below does not show the session.
var_dump($_SESSION);
die();
?>
【问题讨论】:
-
你检查浏览器是否有苦力?
-
@SimonMüller 我已经尝试过隐身,我已经尝试过我的手机浏览器
标签: php amazon-web-services session amazon-ec2 composer-php