5
use CodeIgniter\Config\BaseConfig;
6
use CodeIgniter\Session\Handlers\BaseHandler;
7
use CodeIgniter\Session\Handlers\FileHandler;
9
class Session extends BaseConfig
12
* --------------------------------------------------------------------------
14
* --------------------------------------------------------------------------
16
* The session storage driver to use:
17
* - `CodeIgniter\Session\Handlers\FileHandler`
18
* - `CodeIgniter\Session\Handlers\DatabaseHandler`
19
* - `CodeIgniter\Session\Handlers\MemcachedHandler`
20
* - `CodeIgniter\Session\Handlers\RedisHandler`
22
* @var class-string<BaseHandler>
24
public string $driver = FileHandler::class;
27
* --------------------------------------------------------------------------
29
* --------------------------------------------------------------------------
31
* The session cookie name, must contain only [0-9a-z_-] characters
33
public string $cookieName = 'ci_session';
36
* --------------------------------------------------------------------------
38
* --------------------------------------------------------------------------
40
* The number of SECONDS you want the session to last.
41
* Setting to 0 (zero) means expire when the browser is closed.
43
public int $expiration = 7200;
46
* --------------------------------------------------------------------------
48
* --------------------------------------------------------------------------
50
* The location to save sessions to and is driver dependent.
52
* For the 'files' driver, it's a path to a writable directory.
53
* WARNING: Only absolute paths are supported!
55
* For the 'database' driver, it's a table name.
56
* Please read up the manual for the format with other session drivers.
58
* IMPORTANT: You are REQUIRED to set a valid save path!
60
public string $savePath = WRITEPATH . 'session';
63
* --------------------------------------------------------------------------
65
* --------------------------------------------------------------------------
67
* Whether to match the user's IP address when reading the session data.
69
* WARNING: If you're using the database driver, don't forget to update
70
* your session table's PRIMARY KEY when changing this setting.
72
public bool $matchIP = false;
75
* --------------------------------------------------------------------------
76
* Session Time to Update
77
* --------------------------------------------------------------------------
79
* How many seconds between CI regenerating the session ID.
81
public int $timeToUpdate = 300;
84
* --------------------------------------------------------------------------
85
* Session Regenerate Destroy
86
* --------------------------------------------------------------------------
88
* Whether to destroy session data associated with the old session ID
89
* when auto-regenerating the session ID. When set to FALSE, the data
90
* will be later deleted by the garbage collector.
92
public bool $regenerateDestroy = false;
95
* --------------------------------------------------------------------------
96
* Session Database Group
97
* --------------------------------------------------------------------------
99
* DB Group for the database session.
101
public ?string $DBGroup = null;
104
* --------------------------------------------------------------------------
105
* Lock Retry Interval (microseconds)
106
* --------------------------------------------------------------------------
108
* This is used for RedisHandler.
110
* Time (microseconds) to wait if lock cannot be acquired.
111
* The default is 100,000 microseconds (= 0.1 seconds).
113
public int $lockRetryInterval = 100_000;
116
* --------------------------------------------------------------------------
118
* --------------------------------------------------------------------------
120
* This is used for RedisHandler.
122
* Maximum number of lock acquisition attempts.
123
* The default is 300 times. That is lock timeout is about 30 (0.1 * 300)
126
public int $lockMaxRetries = 300;