问题解决了,问题是被劫持的会话发生了攻击
我刚刚升级到一个新的php版本,似乎会话将不再起作用,它们注册正常,但在页面重新加载后它们不再起作用,它们就不见了。
我尝试过很多东西,比如session.save_path。
我的PHP:PHP版本5.4.32
<?php
session_start();
$_SESSION['test'] = 123; //when i remove this line and i refresh the page, the session is gone
print_r($_SESSION); ?>
这是我的php信息,会话的部分:
Session Support enabled
Registered save handlers files user
Registered serializer handlers php php_binary
Directive Local Value Master Value
session.auto_start Off Off
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_httponly Off Off
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.entropy_file /dev/urandom /dev/urandom
session.entropy_length 32 32
session.gc_divisor 1000 1000
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.hash_bits_per_character 5 5
session.hash_function 0 0
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path /tmp /tmp
session.serialize_handler php php
session.upload_progress.cleanup On On
session.upload_progress.enabled On On
session.upload_progress.freq 1% 1%
session.upload_progress.min_freq 1 1
session.upload_progress.name PHP_SESSION_UPLOAD_PROGRESS PHP_SESSION_UPLOAD_PROGRESS
session.upload_progress.prefix upload_progress_ upload_progress_
session.use_cookies On On
session.use_only_cookies On On
session.use_trans_sid 0 0
答案 0 :(得分:0)
提供存储会话文件的目录,并确保服务器用户可以读取它们。
sessions.save_path = "/path/to/your/folder"
否则,您可以直接在php文件中使用
ini_set(session.save_path, '/path/to/your/folder')