Skip to content

Commit

Permalink
Correct name for the $expire param, also type and description
Browse files Browse the repository at this point in the history
  • Loading branch information
spaze committed Mar 22, 2024
1 parent b133911 commit ced4218
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 (`'/'`)
Expand All @@ -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');
Expand Down

0 comments on commit ced4218

Please sign in to comment.