work/config/session.php

30 lines
770 B
PHP
Raw Normal View History

2019-01-17 11:05:47 +08:00
<?php
/* 定义Session会话字段名 */
$session_name = 's' . substr(md5(__DIR__), -8);
$session_path = env('runtime_path') . 'sess' . DIRECTORY_SEPARATOR;
file_exists($session_path) || mkdir($session_path, 0755, true);
/* 定义Session会话参数 */
return [
'id' => '',
'type' => 'redis',
2019-01-17 11:05:47 +08:00
'prefix' => 'ta',
'expire' => 3600 * 24,
2019-01-17 11:05:47 +08:00
'auto_start' => true,
'path' => $session_path,
'name' => $session_name,
'var_session_id' => $session_name,
// 'use_trans_sid' => 0,
// 'httponly' => true,
// 'secure' => true,
// redis主机
'host' => '127.0.0.1',
// redis端口
'port' => 6379,
// 密码
'password' => '',
2019-01-17 11:05:47 +08:00
];