Skip to content

SetCookieCollection

  • Full name: \Qubus\Http\Cookies\SetCookieCollection
  • This class is marked as final and can't be subclassed
  • This class is a Final class

Properties

name

private ?string $name

value

private ?string $value

expires

private int $expires

maxAge

private int $maxAge

path

private ?string $path

domain

private ?string $domain

secure

private bool $secure

httpOnly

private bool $httpOnly

sameSite

private ?\Qubus\Http\Cookies\SameSite $sameSite

Methods

__construct

private __construct(string $name, ?string $value = null): mixed

Parameters:

Parameter Type Description
$name string
$value ?string

getName

Retrieve name.

public getName(): string

getValue

Retrieve value.

public getValue(): ?string

getExpires

Retrieve expiry.

public getExpires(): int

getMaxAge

Retrieve max age.

public getMaxAge(): int

getPath

Retrieve path.

public getPath(): ?string

getDomain

Retrieve domain.

public getDomain(): ?string

getSecure

Is SetCookieCollection set to secure?

public getSecure(): bool

getHttpOnly

Check if set to http only.

public getHttpOnly(): bool

getSameSite

Retrieve samesite.

public getSameSite(): ?\Qubus\Http\Cookies\SameSite

withValue

Return an instance with the provided value.

public withValue(?string $value = null): self

Parameters:

Parameter Type Description
$value ?string

resolveExpires

private resolveExpires(\DateTimeInterface|int|string|null $expires = null): int

Parameters:

Parameter Type Description
$expires \DateTimeInterface|int|string|null

Throws:


withExpires

Return an instance with the provided expiry.

public withExpires(\DateTimeInterface|int|string|null $expires = null): \Qubus\Http\Cookies\SetCookieCollection

Parameters:

Parameter Type Description
$expires \DateTimeInterface|int|string|null

Throws:


rememberForever

public rememberForever(): self

Throws:


expire

public expire(): self

Throws:


withMaxAge

Return an instance with the provided max age.

public withMaxAge(?int $maxAge = null): self

Parameters:

Parameter Type Description
$maxAge ?int

withPath

Return an instance with the provided path.

public withPath(?string $path = null): self

Parameters:

Parameter Type Description
$path ?string

withDomain

Return an instance with the provided domain.

public withDomain(?string $domain = null): self

Parameters:

Parameter Type Description
$domain ?string

withSecure

Return an instance with/without

public withSecure(bool $secure = true): self

Parameters:

Parameter Type Description
$secure bool

withHttpOnly

public withHttpOnly(bool $httpOnly = true): self

Parameters:

Parameter Type Description
$httpOnly bool

withSameSite

public withSameSite(\Qubus\Http\Cookies\SameSite $sameSite): self

Parameters:

Parameter Type Description
$sameSite \Qubus\Http\Cookies\SameSite

withoutSameSite

public withoutSameSite(): self

__toString

public __toString(): string

create

public static create(string $name, ?string $value = null): self
  • This method is static.

Parameters:

Parameter Type Description
$name string
$value ?string

createRememberedForever

public static createRememberedForever(string $name, ?string $value = null): self
  • This method is static.

Parameters:

Parameter Type Description
$name string
$value ?string

Throws:


createExpired

public static createExpired(string $name): self
  • This method is static.

Parameters:

Parameter Type Description
$name string

Throws:


fromSetCookieString

public static fromSetCookieString(string $string): self
  • This method is static.

Parameters:

Parameter Type Description
$string string

Throws:


appendFormattedDomainPartIfSet

private appendFormattedDomainPartIfSet(string[] $cookieStringParts): string[]

Parameters:

Parameter Type Description
$cookieStringParts string[]

appendFormattedPathPartIfSet

private appendFormattedPathPartIfSet(string[] $cookieStringParts): string[]

Parameters:

Parameter Type Description
$cookieStringParts string[]

appendFormattedExpiresPartIfSet

private appendFormattedExpiresPartIfSet(string[] $cookieStringParts): string[]

Parameters:

Parameter Type Description
$cookieStringParts string[]

appendFormattedMaxAgePartIfSet

private appendFormattedMaxAgePartIfSet(string[] $cookieStringParts): string[]

Parameters:

Parameter Type Description
$cookieStringParts string[]

appendFormattedSecurePartIfSet

private appendFormattedSecurePartIfSet(string[] $cookieStringParts): string[]

Parameters:

Parameter Type Description
$cookieStringParts string[]

appendFormattedHttpOnlyPartIfSet

private appendFormattedHttpOnlyPartIfSet(string[] $cookieStringParts): string[]

Parameters:

Parameter Type Description
$cookieStringParts string[]

appendFormattedSameSitePartIfSet

private appendFormattedSameSitePartIfSet(string[] $cookieStringParts): string[]

Parameters:

Parameter Type Description
$cookieStringParts string[]


Automatically generated on 2025-10-13