ci4

Форк
0
/
Session.php 
127 строк · 4.5 Кб
1
<?php
2

3
namespace Config;
4

5
use CodeIgniter\Config\BaseConfig;
6
use CodeIgniter\Session\Handlers\BaseHandler;
7
use CodeIgniter\Session\Handlers\FileHandler;
8

9
class Session extends BaseConfig
10
{
11
    /**
12
     * --------------------------------------------------------------------------
13
     * Session Driver
14
     * --------------------------------------------------------------------------
15
     *
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`
21
     *
22
     * @var class-string<BaseHandler>
23
     */
24
    public string $driver = FileHandler::class;
25

26
    /**
27
     * --------------------------------------------------------------------------
28
     * Session Cookie Name
29
     * --------------------------------------------------------------------------
30
     *
31
     * The session cookie name, must contain only [0-9a-z_-] characters
32
     */
33
    public string $cookieName = 'ci_session';
34

35
    /**
36
     * --------------------------------------------------------------------------
37
     * Session Expiration
38
     * --------------------------------------------------------------------------
39
     *
40
     * The number of SECONDS you want the session to last.
41
     * Setting to 0 (zero) means expire when the browser is closed.
42
     */
43
    public int $expiration = 7200;
44

45
    /**
46
     * --------------------------------------------------------------------------
47
     * Session Save Path
48
     * --------------------------------------------------------------------------
49
     *
50
     * The location to save sessions to and is driver dependent.
51
     *
52
     * For the 'files' driver, it's a path to a writable directory.
53
     * WARNING: Only absolute paths are supported!
54
     *
55
     * For the 'database' driver, it's a table name.
56
     * Please read up the manual for the format with other session drivers.
57
     *
58
     * IMPORTANT: You are REQUIRED to set a valid save path!
59
     */
60
    public string $savePath = WRITEPATH . 'session';
61

62
    /**
63
     * --------------------------------------------------------------------------
64
     * Session Match IP
65
     * --------------------------------------------------------------------------
66
     *
67
     * Whether to match the user's IP address when reading the session data.
68
     *
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.
71
     */
72
    public bool $matchIP = false;
73

74
    /**
75
     * --------------------------------------------------------------------------
76
     * Session Time to Update
77
     * --------------------------------------------------------------------------
78
     *
79
     * How many seconds between CI regenerating the session ID.
80
     */
81
    public int $timeToUpdate = 300;
82

83
    /**
84
     * --------------------------------------------------------------------------
85
     * Session Regenerate Destroy
86
     * --------------------------------------------------------------------------
87
     *
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.
91
     */
92
    public bool $regenerateDestroy = false;
93

94
    /**
95
     * --------------------------------------------------------------------------
96
     * Session Database Group
97
     * --------------------------------------------------------------------------
98
     *
99
     * DB Group for the database session.
100
     */
101
    public ?string $DBGroup = null;
102

103
    /**
104
     * --------------------------------------------------------------------------
105
     * Lock Retry Interval (microseconds)
106
     * --------------------------------------------------------------------------
107
     *
108
     * This is used for RedisHandler.
109
     *
110
     * Time (microseconds) to wait if lock cannot be acquired.
111
     * The default is 100,000 microseconds (= 0.1 seconds).
112
     */
113
    public int $lockRetryInterval = 100_000;
114

115
    /**
116
     * --------------------------------------------------------------------------
117
     * Lock Max Retries
118
     * --------------------------------------------------------------------------
119
     *
120
     * This is used for RedisHandler.
121
     *
122
     * Maximum number of lock acquisition attempts.
123
     * The default is 300 times. That is lock timeout is about 30 (0.1 * 300)
124
     * seconds.
125
     */
126
    public int $lockMaxRetries = 300;
127
}
128

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.