diff --git a/src/FileHandler.php b/src/FileHandler.php index 563e84f..2753072 100644 --- a/src/FileHandler.php +++ b/src/FileHandler.php @@ -35,9 +35,7 @@ public function open(string $savePath, string $name):bool { return $success; } - /** - * @link http://php.net/manual/en/sessionhandlerinterface.close.php - */ + /** @link http://php.net/manual/en/sessionhandlerinterface.close.php */ public function close():bool { return true; } diff --git a/src/Session.php b/src/Session.php index 713a823..a89a96d 100644 --- a/src/Session.php +++ b/src/Session.php @@ -16,7 +16,7 @@ class Session implements SessionContainer, TypeSafeGetter { const DEFAULT_SESSION_SECURE = true; const DEFAULT_SESSION_HTTPONLY = true; const DEFAULT_COOKIE_PATH = "/"; - const DEFAULT_COOKIE_SAMESITE = "Strict"; + const DEFAULT_COOKIE_SAMESITE = "Lax"; const DEFAULT_STRICT_MODE = true; const DEFAULT_SESSION_ID_LENGTH = 64; const DEFAULT_SESSION_ID_BITS_PER_CHARACTER = 5; @@ -29,7 +29,7 @@ class Session implements SessionContainer, TypeSafeGetter { public function __construct( SessionHandlerInterface $sessionHandler, array|ArrayAccess $config = [], - string $id = null + string $id = null, ) { $this->sessionHandler = $sessionHandler; @@ -137,14 +137,12 @@ public function write():bool { /** @param ArrayAccess|array $config */ private function setIniDefaults(ArrayAccess|array $config):void { - // phpcs:ignore - @ini_set( + ini_set( "session.sid_length", $config["sid_length"] ?? self::DEFAULT_SESSION_ID_LENGTH ); - // phpcs:ignore - @ini_set( + ini_set( "session.sid_bits_per_character", $config["sid_bits_per_character"] ?? (string)self::DEFAULT_SESSION_ID_BITS_PER_CHARACTER