shopxo/config/session.php

44 lines
1.7 KiB
PHP
Raw Normal View History

2020-11-15 20:34:18 +08:00
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
2021-03-16 10:34:52 +08:00
// | Copyright (c) 2011~2099 http://shopxo.net All rights reserved.
2020-11-15 20:34:18 +08:00
// +----------------------------------------------------------------------
2021-03-16 10:34:52 +08:00
// | Licensed ( https://opensource.org/licenses/mit-license.php )
2020-11-15 20:34:18 +08:00
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
2021-07-18 23:42:10 +08:00
// +----------------------------------------------------------------------
// | 会话设置
// +----------------------------------------------------------------------
if(MyFileConfig('common_session_is_use_cache', '', 0, true) == 1)
2020-11-15 20:34:18 +08:00
{
// redis配置
2021-07-18 23:42:10 +08:00
// 请确保缓存配置文件cache.php中的stores中已经添加了redis缓存配置
2020-11-15 20:34:18 +08:00
$config = [
2024-04-15 10:35:58 +08:00
'type' => 'cache',
'store' => 'redis',
'prefix' => MyFileConfig('common_cache_session_redis_prefix', '', 'shopxo', true),
2024-04-15 10:25:01 +08:00
// 过期时间
2024-04-15 10:35:58 +08:00
'expire' => 43200,
2020-11-15 20:34:18 +08:00
];
} else {
// 默认配置
$config = [
2021-07-18 23:42:10 +08:00
// session name
2024-04-15 10:35:58 +08:00
'name' => 'PHPSESSID',
2020-11-15 20:34:18 +08:00
// SESSION_ID的提交变量,解决flash上传跨域
2024-04-15 10:35:58 +08:00
'var_session_id' => '',
2021-07-18 23:42:10 +08:00
// 驱动方式 支持file cache
2024-04-15 10:35:58 +08:00
'type' => 'file',
2021-07-18 23:42:10 +08:00
// 存储连接标识 当type使用cache的时候有效
2024-04-15 10:35:58 +08:00
'store' => null,
2021-07-18 23:42:10 +08:00
// 过期时间
2024-04-15 10:35:58 +08:00
'expire' => 43200,
2021-07-18 23:42:10 +08:00
// 前缀
2024-04-15 10:35:58 +08:00
'prefix' => 'shopxo',
2020-11-15 20:34:18 +08:00
];
}
return $config;
?>