如题;
修改文件
config/session.php
为如下:
<?php
$sess_path_ = env('runtime_path').'sess'.DIRECTORY_SEPARATOR;
file_exists($sess_path_) || mkdir($sess_path_, 0755, true);
$sess_name_ = 's'.substr(md5(__DIR__), -8);
return [
//文件方式
'prefix' => 'ab',
'path' => $sess_path_,
'name' => $sess_name_,
// 'var_session_id' => $sess_name_,
//redis session
'type' => 'redis', // 驱动方式
'host' => '127.0.0.1', // redis主机
'port' => 6379, // redis端口
//'password' => '',
];
参考:
https://doc.thinkphp.cn/v5_1/Session.html