Implement session inactivity expiration handling.
This commit is contained in:
parent
b9b7b23e9e
commit
e9269a24fc
4 changed files with 32 additions and 1 deletions
|
@ -123,6 +123,9 @@
|
|||
// Server Policies
|
||||
// The maximum number of signing keys a peer can register onto the server at once
|
||||
$config->setDefault('policies.max_signing_keys', 20);
|
||||
// The amount of time in seconds it takes before a session is considered expired due to inactivity
|
||||
// Default: 12hours
|
||||
$config->setDefault('policies.session_inactivity_expires', 43200);
|
||||
|
||||
// Storage configuration
|
||||
$config->setDefault('storage.path', '/etc/socialbox'); // The main path for file storage
|
||||
|
|
|
@ -5,10 +5,12 @@
|
|||
class PoliciesConfiguration
|
||||
{
|
||||
private int $maxSigningKeys;
|
||||
private int $sessionInactivityExpires;
|
||||
|
||||
public function __construct(array $data)
|
||||
{
|
||||
$this->maxSigningKeys = $data['max_signing_keys'];
|
||||
$this->sessionInactivityExpires = $data['session_inactivity_expires'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -18,4 +20,12 @@
|
|||
{
|
||||
return $this->maxSigningKeys;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getSessionInactivityExpires(): int
|
||||
{
|
||||
return $this->sessionInactivityExpires;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue