-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdefault_config.php
More file actions
57 lines (52 loc) · 3.33 KB
/
Copy pathdefault_config.php
File metadata and controls
57 lines (52 loc) · 3.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
use Ghostff\Session\Drivers\File;
use Ghostff\Session\Session;
return [
Session::CONFIG_DRIVER => File::class, # Name of session driver to use: Session\[File|MySql|Cookie|Redis|Memcached]\Handler::class
Session::CONFIG_ENCRYPT_DATA => false, # Allow encryption of session data.
Session::CONFIG_SALT_KEY => 'secret_salt_key', # Encryption key. ineffective if 'encrypt_data' = false
Session::CONFIG_AUTO_COMMIT => true, # Auto commit unsaved changes.
# https://www.php.net/manual/en/session.configuration.php
Session::CONFIG_START_OPTIONS => [
'name' => 'SESS_ID', # Session name
'save_path' => sys_get_temp_dir(), # This is the path where the files are created.
'cache_limiter' => 'private', # Cache control method used for session pages.
'cookie_secure' => '', # Specifies whether cookies should only be sent over secure connections.
'cookie_domain' => '', # Specifies the domain to set in the session cookie.
'cookie_path' => '/', # Specifies path to set in the session cookie.
'cookie_lifetime' => '0', # Specifies the lifetime of the cookie in seconds which is sent to the browser. The value 0 means "until the browser is closed."
'gc_maxlifetime' => '1440', # Specifies the number of seconds after which data will be seen as 'garbage' and potentially cleaned up.
'use_strict_mode' => '1', # Specifies whether the module will use strict session id mode.
'gc_probability' => '1', # https://www.php.net/manual/en/session.configuration.php#ini.session.gc-probability
'gc_divisor' => '100', # https://www.php.net/manual/en/session.configuration.php#ini.session.gc-divisor
],
Session::CONFIG_MYSQL_DS => [
'driver' => 'mysql', # Database driver for PDO dns eg(mysql:host=...;dbname=...)
'host' => '127.0.0.1', # Database host
'db_name' => 'mysql', # Database name
'db_table' => 'session', # Database table
'db_user' => 'root', # Database username
'db_pass' => '', # Database password
'persistent_conn' => false, # Avoid the overhead of establishing a new connection every time a script needs to talk to a database, resulting in a faster web application. FIND THE BACKSIDE YOURSELF
],
Session::CONFIG_MEMCACHED_DS => [
'servers' => [
['127.0.0.1', 11211, 0],
],
'compress' => true,
'save_path' => '127.0.0.1:11211', #comma separated of hostname:port entries to use for session server pool.
'persistent_id' => 'sess_pool',
],
Session::CONFIG_REDIS_DS => [
'host' => '127.0.0.1',
'port' => 6379,
'save_path' => 'tcp://127.0.0.1:6379', #comma separated of hostname:port entries to use for session server pool.
'persistent_id' => 'sess_pool',
'timeout' => 2.5
],
Session::CONFIG_SQLITE_DS => [
'driver' => 'SQLite',
'db_path' => 'sessions.db',
'db_table' => 'sessions',
]
];