Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
Session
n/a
0 / 0
n/a
0 / 0
0
n/a
0 / 0
1<?php
2
3namespace Config;
4
5use CodeIgniter\Config\BaseConfig;
6use CodeIgniter\Session\Handlers\BaseHandler;
7use CodeIgniter\Session\Handlers\FileHandler;
8
9class Session extends BaseConfig
10{
11    /**
12     * --------------------------------------------------------------------------
13     * Session Driver
14     * --------------------------------------------------------------------------
15     *
16     * The session storage driver to use:
17     * - `CodeIgniter\Session\Handlers\ArrayHandler` (for testing)
18     * - `CodeIgniter\Session\Handlers\FileHandler`
19     * - `CodeIgniter\Session\Handlers\DatabaseHandler`
20     * - `CodeIgniter\Session\Handlers\MemcachedHandler`
21     * - `CodeIgniter\Session\Handlers\RedisHandler`
22     *
23     * @var class-string<BaseHandler>
24     */
25    public string $driver = FileHandler::class;
26
27    /**
28     * --------------------------------------------------------------------------
29     * Session Cookie Name
30     * --------------------------------------------------------------------------
31     *
32     * The session cookie name, must contain only [0-9a-z_-] characters
33     */
34    public string $cookieName = 'ci_session';
35
36    /**
37     * --------------------------------------------------------------------------
38     * Session Expiration
39     * --------------------------------------------------------------------------
40     *
41     * The number of SECONDS you want the session to last.
42     * Setting to 0 (zero) means expire when the browser is closed.
43     */
44    public int $expiration = 7200;
45
46    /**
47     * --------------------------------------------------------------------------
48     * Session Save Path
49     * --------------------------------------------------------------------------
50     *
51     * The location to save sessions to and is driver dependent.
52     *
53     * For the 'files' driver, it's a path to a writable directory.
54     * WARNING: Only absolute paths are supported!
55     *
56     * For the 'database' driver, it's a table name.
57     * Please read up the manual for the format with other session drivers.
58     *
59     * IMPORTANT: You are REQUIRED to set a valid save path!
60     */
61    public string $savePath = WRITEPATH . 'session';
62
63    /**
64     * --------------------------------------------------------------------------
65     * Session Match IP
66     * --------------------------------------------------------------------------
67     *
68     * Whether to match the user's IP address when reading the session data.
69     *
70     * WARNING: If you're using the database driver, don't forget to update
71     *          your session table's PRIMARY KEY when changing this setting.
72     */
73    public bool $matchIP = false;
74
75    /**
76     * --------------------------------------------------------------------------
77     * Session Time to Update
78     * --------------------------------------------------------------------------
79     *
80     * How many seconds between CI regenerating the session ID.
81     */
82    public int $timeToUpdate = 300;
83
84    /**
85     * --------------------------------------------------------------------------
86     * Session Regenerate Destroy
87     * --------------------------------------------------------------------------
88     *
89     * Whether to destroy session data associated with the old session ID
90     * when auto-regenerating the session ID. When set to FALSE, the data
91     * will be later deleted by the garbage collector.
92     */
93    public bool $regenerateDestroy = false;
94
95    /**
96     * --------------------------------------------------------------------------
97     * Session Database Group
98     * --------------------------------------------------------------------------
99     *
100     * DB Group for the database session.
101     */
102    public ?string $DBGroup = null;
103
104    /**
105     * --------------------------------------------------------------------------
106     * Lock Retry Interval (microseconds)
107     * --------------------------------------------------------------------------
108     *
109     * This is used for RedisHandler.
110     *
111     * Time (microseconds) to wait if lock cannot be acquired.
112     * The default is 100,000 microseconds (= 0.1 seconds).
113     */
114    public int $lockRetryInterval = 100_000;
115
116    /**
117     * --------------------------------------------------------------------------
118     * Lock Max Retries
119     * --------------------------------------------------------------------------
120     *
121     * This is used for RedisHandler.
122     *
123     * Maximum number of lock acquisition attempts.
124     * The default is 300 times. That is lock timeout is about 30 (0.1 * 300)
125     * seconds.
126     */
127    public int $lockMaxRetries = 300;
128}