- Fixed the all() function of session

- Defined default session cookie to 12hours
This commit is contained in:
Dave Mc Nicoll 2020-05-20 15:34:12 -04:00
parent 128363c476
commit 754349f523
2 changed files with 6 additions and 1 deletions

View File

@ -32,6 +32,11 @@ class Session
{ {
$_SESSION = []; $_SESSION = [];
} }
public static function all() : array
{
return $_SESSION;
}
public static function start(array $options, Cookie $cookie, string $savePath) : void public static function start(array $options, Cookie $cookie, string $savePath) : void
{ {

View File

@ -16,7 +16,7 @@ class SessionMiddleware implements MiddlewareInterface
'domain' => null, 'domain' => null,
'secure' => false, 'secure' => false,
'httponly' => true, 'httponly' => true,
'lifetime' => 28800, # A day of work ~ 8 hours 'lifetime' => 43200, # A half-day
'samesite' => "", 'samesite' => "",
]; ];