]> BookStack Code Mirror - bookstack/blob - app/Config/session.php
do some cleanup and add doc
[bookstack] / app / Config / session.php
1 <?php
2
3 use Illuminate\Support\Str;
4
5 /**
6  * Session configuration options.
7  *
8  * Changes to these config files are not supported by BookStack and may break upon updates.
9  * Configuration should be altered via the `.env` file or environment variables.
10  * Do not edit this file unless you're happy to maintain any changes yourself.
11  */
12
13 return [
14
15     // Default session driver
16     // Options: file, cookie, database, redis, memcached, array
17     'driver' => env('SESSION_DRIVER', 'file'),
18
19     // Session lifetime, in minutes
20     'lifetime' => env('SESSION_LIFETIME', 120),
21
22     // Expire session on browser close
23     'expire_on_close' => false,
24
25     // Encrypt session data
26     'encrypt' => false,
27
28     // Location to store session files
29     'files' => storage_path('framework/sessions'),
30
31     // Session Database Connection
32     // When using the "database" or "redis" session drivers, you can specify a
33     // connection that should be used to manage these sessions. This should
34     // correspond to a connection in your database configuration options.
35     'connection' => null,
36
37     // Session database table, if database driver is in use
38     'table' => 'sessions',
39
40     // Session Cache Store
41     // When using the "apc" or "memcached" session drivers, you may specify a
42     // cache store that should be used for these sessions. This value must
43     // correspond with one of the application's configured cache stores.
44     'store' => null,
45
46     // Session Sweeping Lottery
47     // Some session drivers must manually sweep their storage location to get
48     // rid of old sessions from storage. Here are the chances that it will
49     // happen on a given request. By default, the odds are 2 out of 100.
50     'lottery' => [2, 100],
51
52     // Session Cookie Name
53     // Here you may change the name of the cookie used to identify a session
54     // instance by ID. The name specified here will get used every time a
55     // new session cookie is created by the framework for every driver.
56     'cookie' => env('SESSION_COOKIE_NAME', 'bookstack_session'),
57
58     // Session Cookie Path
59     // The session cookie path determines the path for which the cookie will
60     // be regarded as available. Typically, this will be the root path of
61     // your application but you are free to change this when necessary.
62     'path' => '/' . (explode('/', env('APP_URL', ''), 4)[3] ?? ''),
63
64     // Session Cookie Domain
65     // Here you may change the domain of the cookie used to identify a session
66     // in your application. This will determine which domains the cookie is
67     // available to in your application. A sensible default has been set.
68     'domain' => env('SESSION_DOMAIN', null),
69
70     // HTTPS Only Cookies
71     // By setting this option to true, session cookies will only be sent back
72     // to the server if the browser has a HTTPS connection. This will keep
73     // the cookie from being sent to you if it can not be done securely.
74     'secure' => env('SESSION_SECURE_COOKIE', null)
75         ?? Str::startsWith(env('APP_URL'), 'https:'),
76
77     // HTTP Access Only
78     // Setting this value to true will prevent JavaScript from accessing the
79     // value of the cookie and the cookie will only be accessible through the HTTP protocol.
80     'http_only' => true,
81
82     // Same-Site Cookies
83     // This option determines how your cookies behave when cross-site requests
84     // take place, and can be used to mitigate CSRF attacks. By default, we
85     // do not enable this as other CSRF protection services are in place.
86     // Options: lax, strict, none
87     'same_site' => 'lax',
88 ];
Morty Proxy This is a proxified and sanitized view of the page, visit original site.