Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #158: Clarify session config instructions. #159

Merged
merged 1 commit into from
Feb 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 69 additions & 8 deletions config/autoload/session.global.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,86 @@
declare(strict_types=1);

return [
/**
* dotkernel/dot-flashmessenger options
* @see https://github.com/dotkernel/dot-flashmessenger
*/
'dot_flashmessenger' => [
'options' => [
/**
* FlashMessenger session container
*/
'namespace' => 'admin_messenger',
]
],

/**
* dotkernel/dot-session options
* @see https://github.com/dotkernel/dot-session
*/
'dot_session' => [
/**
* Amount of seconds of inactivity for which the system will extend session.
*
* While the difference between now and LAST_ACTIVITY stored in session is less than rememberMeInactive,
* the session will be extended => user will not be logged out due to inactivity.
*/
'rememberMeInactive' => 1800,
],

/**
* laminas/laminas-session options
* @see https://docs.laminas.dev/laminas-session/config/
*/
'session_config' => [
'cookie_domain' => '',
'cookie_httponly' => true,
'cookie_lifetime' => 3600 * 24 * 30,
'cookie_path' => '/',
'cookie_samesite' => 'Lax',
'cookie_secure' => true,
'name' => 'ADMIN_SESSID',
/**
* Specifies the domain to set in the session cookie.
*/
'cookie_domain' => '',

/**
* Marks the cookie as accessible only through the HTTP protocol.
*/
'cookie_httponly' => true,

/**
* Specifies the lifetime of the cookie in seconds which is sent to the browser.
*/
'cookie_lifetime' => 3600 * 24 * 30,

/**
* Specifies path to set in the session cookie.
*/
'cookie_path' => '/',

/**
* Specifies whether cookies should be sent along with cross-site requests.
*/
'cookie_samesite' => 'Lax',

/**
* Specifies whether cookies should only be sent over secure connections.
*/
'cookie_secure' => true,

/**
* Specifies the name of the session which is used as cookie name.
*/
'name' => 'ADMIN_SESSID',

/**
* Specifies how long to remember the session before clearing data.
*/
'remember_me_seconds' => 3600 * 24 * 30,
'use_cookies' => true,

/**
* Specifies whether the module will use cookies to store the session id.
*/
'use_cookies' => true,
],
/**
* Allows creating Container instances.
*/
'session_containers' => [
'user',
],
Expand Down