From ced42184ac3028b82baaf109232e0042bdc4c94e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C5=A0pa=C4=8Dek?= Date: Fri, 22 Mar 2024 03:23:57 +0100 Subject: [PATCH] Correct name for the $expire param, also type and description --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index ddb92992..7731214b 100644 --- a/readme.md +++ b/readme.md @@ -307,7 +307,7 @@ Sets the expiration of the HTTP document using the `Cache-Control` and `Expires` $httpResponse->setExpiration('1 hour'); ``` -setCookie(string $name, string $value, $time, string $path = null, string $domain = null, bool $secure = null, bool $httpOnly = null, string $sameSite = null) +setCookie(string $name, string $value, string|int|\DateTimeInterface|null $expire, string $path = null, string $domain = null, bool $secure = null, bool $httpOnly = null, string $sameSite = null) -------------------------------------------------------------------------------------------------------------------------------------------------------------- Sends a cookie. The default values ​​of the parameters are: - `$path` with scope to all directories (`'/'`) @@ -316,7 +316,7 @@ Sends a cookie. The default values ​​of the parameters are: - `$httpOnly` is true, so the cookie is inaccessible to JavaScript - `$sameSite` is null, so the flag is not specified -The time can be specified as a string or the number of seconds. +The `$expire` parameter can be specified as a string, an object implementing `DateTimeInterface`, or the number of seconds. ```php $httpResponse->setCookie('lang', 'en', '100 days');