Skip to content

Commit

Permalink
Update Factory.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Idrinth authored Jul 22, 2023
1 parent da94503 commit 90ea000
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ class Factory
{
public static function start(bool $isWriteable = false): void
{
$duration = (int) ($_ENV['SESSION_DURATION'] ?? 7200);
$hasMemcached = extension_loaded('memcached') && ($_ENV['ENABLE_MEMCACHED'] ?? 'false') === 'true';
$duration = (int) ($_ENV['SESSION_DURATION'] ?: 7200);
$hasMemcached = extension_loaded('memcached') && ($_ENV['ENABLE_MEMCACHED'] ?: 'false') === 'true';
session_set_save_handler(
$hasMemcached ? new Memcache($duration) : new File($duration, $_ENV['SESSION_PATH'] ?? sys_get_temp_dir()),
$hasMemcached ? new Memcache($duration) : new File($duration, $_ENV['SESSION_PATH'] ?: sys_get_temp_dir()),
true
);
session_set_cookie_params([
Expand Down

0 comments on commit 90ea000

Please sign in to comment.