mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 11:11:39 +09:00
Add options to control autologin cookie lifetime and refresh function
This commit is contained in:
parent
87300c9944
commit
4af7354bf0
7 changed files with 24 additions and 2 deletions
|
|
@ -32,6 +32,8 @@ class Security extends Base
|
|||
Context::set('remote_addr', RX_CLIENT_IP);
|
||||
|
||||
// Session and cookie security settings
|
||||
Context::set('autologin_lifetime', Config::get('session.autologin_lifetime') ?: 365);
|
||||
Context::set('autologin_refresh', Config::get('session.autologin_refresh') ?? true);
|
||||
Context::set('use_httponly', Config::get('session.httponly'));
|
||||
Context::set('use_samesite', Config::get('session.samesite'));
|
||||
Context::set('use_session_ssl', Config::get('session.use_ssl'));
|
||||
|
|
@ -127,6 +129,8 @@ class Security extends Base
|
|||
|
||||
Config::set('admin.allow', array_values($allowed_ip));
|
||||
Config::set('admin.deny', array_values($denied_ip));
|
||||
Config::set('session.autologin_lifetime', max(1, min(400, intval($vars->autologin_lifetime))));
|
||||
Config::set('session.autologin_refresh', ($vars->autologin_refresh ?? 'N') === 'Y');
|
||||
Config::set('session.httponly', $vars->use_httponly === 'Y');
|
||||
Config::set('session.samesite', $vars->use_samesite);
|
||||
Config::set('session.use_ssl', $vars->use_session_ssl === 'Y');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue