Methods |
public
static
|
fromHeader(non-empty-string $header, bool $raw = false): self
Converts a Set-Cookie header string to a CookieInterface object.
Converts a Set-Cookie header string to a CookieInterface object.
Parameters
$header |
The Set-Cookie header string
|
$raw |
Whether the cookie value should be sent without URL encoding
|
Throws
Implemented by
|
#
|
public
|
getPrefix(): string
Gets the prefix of the cookie.
Gets the prefix of the cookie.
Implemented by
|
#
|
public
|
getName(): non-empty-string
Gets the name of the cookie without the prefix.
Gets the name of the cookie without the prefix.
Implemented by
|
#
|
public
|
getPrefixedName(): non-empty-string
Gets the name of the cookie with the prefix.
Gets the name of the cookie with the prefix.
Implemented by
|
#
|
public
|
getValue(): string
Gets the value of the cookie.
Gets the value of the cookie.
Implemented by
|
#
|
public
|
getPath(): string
Gets the path on the server in which the cookie will be available on.
Gets the path on the server in which the cookie will be available on.
Implemented by
|
#
|
public
|
getDomain(): string
Gets the (sub)domain that the cookie is available to.
Gets the (sub)domain that the cookie is available to.
Implemented by
|
#
|
public
|
getMaxAge(): int<0, max>
Gets the Max-Age attribute of the cookie.
Gets the Max-Age attribute of the cookie.
Implemented by
|
#
|
public
|
getExpiresTimestamp(): int<0, max>
Gets the time when the cookie expires.
Gets the time when the cookie expires.
Implemented by
|
#
|
public
|
isExpired(): bool
Indicates if the cookie has expired.
Indicates if the cookie has expired.
Implemented by
|
#
|
public
|
isSecure(): bool
Indicates if the cookie should only be transmitted over a secure HTTPS connection from the client.
Indicates if the cookie should only be transmitted over a secure HTTPS connection from the client.
Implemented by
|
#
|
public
|
isHttpOnly(): bool
Indicates if the cookie will be accessible only through the HTTP protocol.
Indicates if the cookie will be accessible only through the HTTP protocol.
Implemented by
|
#
|
public
|
getSameSite(): self::SAMESITE_*
Gets the SameSite attribute of the cookie.
Gets the SameSite attribute of the cookie.
Implemented by
|
#
|
public
|
getOptions(): array{expires: int<0, max>, path: string, domain: string, secure: bool, httponly: bool, samesite: string}
Gets the cookie options that are passable to the setcookie() function.
Gets the cookie options that are passable to the setcookie() function.
Implemented by
|
#
|
public
|
isRaw(): bool
Indicates if the cookie value should be sent without URL encoding.
Indicates if the cookie value should be sent without URL encoding.
Implemented by
|
#
|
public
|
isPartitioned(): bool
Indicates if the cookie should be tied to the top-level site in a cross-site context.
Indicates if the cookie should be tied to the top-level site in a cross-site context.
Implemented by
|
#
|
public
|
withPrefix(string $prefix): self
Creates a cookie object with the new prefix.
Creates a cookie object with the new prefix.
Implemented by
|
#
|
public
|
withName(string $name): self
Creates a cookie object with the new name.
Creates a cookie object with the new name.
Implemented by
|
#
|
public
|
withValue(string $value): self
Creates a cookie object with the new value.
Creates a cookie object with the new value.
Implemented by
|
#
|
public
|
withPath(string $path): self
Creates a cookie object with the new Path attribute.
Creates a cookie object with the new Path attribute.
Implemented by
|
#
|
public
|
withDomain(string $domain): self
Creates a cookie object with the new Domain attribute.
Creates a cookie object with the new Domain attribute.
Implemented by
|
#
|
public
|
withMaxAge(int $maxAge): self
Creates a cookie object with the new Max-Age attribute.
Creates a cookie object with the new Max-Age attribute.
Implemented by
|
#
|
public
|
withExpiresTime(DateTimeInterface|int<0, max>|string $expires): self
Creates a cookie object with the new Expires attribute.
Creates a cookie object with the new Expires attribute.
Implemented by
|
#
|
public
|
withSecure(bool $secure): self
Creates a cookie object with the new Secure attribute.
Creates a cookie object with the new Secure attribute.
Implemented by
|
#
|
public
|
withHttpOnly(bool $httpOnly): self
Creates a cookie object with the new HttpOnly attribute.
Creates a cookie object with the new HttpOnly attribute.
Implemented by
|
#
|
public
|
withSameSite(?string $sameSite): self
Creates a cookie object with the new SameSite attribute.
Creates a cookie object with the new SameSite attribute.
Implemented by
|
#
|
public
|
withRaw(bool $raw): self
Creates a cookie object that whether the cookie value should be sent without URL encoding.
Creates a cookie object that whether the cookie value should be sent without URL encoding.
Implemented by
|
#
|
public
|
withPartitioned(bool $partitioned): self
Creates a cookie object that whether the cookie should be tied to the top-level site in a cross-site context.
Creates a cookie object that whether the cookie should be tied to the top-level site in a cross-site context.
Implemented by
|
#
|