Open Journal Systems  3.3.0
Symfony\Component\HttpFoundation\Cookie Class Reference

Public Member Functions

 __construct ($name, $value=null, $expire=0, $path='/', $domain=null, $secure=false, $httpOnly=true, $raw=false, $sameSite=null)
 
 __construct (string $name, string $value=null, $expire=0, ?string $path='/', string $domain=null, ?bool $secure=false, bool $httpOnly=true, bool $raw=false, string $sameSite=null)
 
 __toString ()
 
 __toString ()
 
 getDomain ()
 
 getDomain ()
 
 getExpiresTime ()
 
 getExpiresTime ()
 
 getMaxAge ()
 
 getMaxAge ()
 
 getName ()
 
 getName ()
 
 getPath ()
 
 getPath ()
 
 getSameSite ()
 
 getSameSite ()
 
 getValue ()
 
 getValue ()
 
 isCleared ()
 
 isCleared ()
 
 isHttpOnly ()
 
 isHttpOnly ()
 
 isRaw ()
 
 isRaw ()
 
 isSecure ()
 
 isSecure ()
 
 setSecureDefault (bool $default)
 

Static Public Member Functions

static create (string $name, string $value=null, $expire=0, ?string $path='/', string $domain=null, bool $secure=null, bool $httpOnly=true, bool $raw=false, ?string $sameSite=self::SAMESITE_LAX)
 
static fromString ($cookie, $decode=false)
 
static fromString ($cookie, $decode=false)
 

Data Fields

const SAMESITE_LAX = 'lax'
 
const SAMESITE_NONE = 'none'
 
const SAMESITE_STRICT = 'strict'
 

Protected Attributes

 $domain
 
 $expire
 
 $httpOnly
 
 $name
 
 $path
 
 $secure
 
 $value
 

Detailed Description

Represents a cookie.

Author
Johannes M. Schmitt schmi.nosp@m.ttjo.nosp@m.h@gma.nosp@m.il.c.nosp@m.om

Definition at line 19 of file lib/vendor/symfony/http-foundation/Cookie.php.

Constructor & Destructor Documentation

◆ __construct() [1/2]

Symfony\Component\HttpFoundation\Cookie::__construct (   $name,
  $value = null,
  $expire = 0,
  $path = '/',
  $domain = null,
  $secure = false,
  $httpOnly = true,
  $raw = false,
  $sameSite = null 
)

Constructor.

Parameters
string$nameThe name of the cookie
string | null$valueThe value of the cookie
int | string | \DateTimeInterface$expireThe time the cookie expires
string$pathThe path on the server in which the cookie will be available on
string | null$domainThe domain that the cookie is available to
bool$secureWhether the cookie should only be transmitted over a secure HTTPS connection from the client
bool$httpOnlyWhether the cookie will be made accessible only through the HTTP protocol
bool$rawWhether the cookie value should be sent with no url encoding
string | null$sameSiteWhether the cookie will be available for cross-site requests
Exceptions

Definition at line 98 of file lib/vendor/symfony/http-foundation/Cookie.php.

References Symfony\Component\HttpFoundation\Cookie\$domain, Symfony\Component\HttpFoundation\Cookie\$expire, Symfony\Component\HttpFoundation\Cookie\$httpOnly, Symfony\Component\HttpFoundation\Cookie\$name, Symfony\Component\HttpFoundation\Cookie\$path, Symfony\Component\HttpFoundation\Cookie\$secure, and Symfony\Component\HttpFoundation\Cookie\$value.

◆ __construct() [2/2]

Symfony\Component\HttpFoundation\Cookie::__construct ( string  $name,
string  $value = null,
  $expire = 0,
?string  $path = '/',
string  $domain = null,
?bool  $secure = false,
bool  $httpOnly = true,
bool  $raw = false,
string  $sameSite = null 
)
Parameters
string$nameThe name of the cookie
string | null$valueThe value of the cookie
int | string | \DateTimeInterface$expireThe time the cookie expires
string$pathThe path on the server in which the cookie will be available on
string | null$domainThe domain that the cookie is available to
bool | null$secureWhether the client should send back the cookie only over HTTPS or null to auto-enable this when the request is already using HTTPS
bool$httpOnlyWhether the cookie will be made accessible only through the HTTP protocol
bool$rawWhether the cookie value should be sent with no url encoding
string | null$sameSiteWhether the cookie will be available for cross-site requests
Exceptions

Definition at line 94 of file vendor/symfony/http-foundation/Cookie.php.

References Symfony\Component\HttpFoundation\Cookie\$domain, Symfony\Component\HttpFoundation\Cookie\$expire, Symfony\Component\HttpFoundation\Cookie\$httpOnly, Symfony\Component\HttpFoundation\Cookie\$name, Symfony\Component\HttpFoundation\Cookie\$path, Symfony\Component\HttpFoundation\Cookie\$secure, and Symfony\Component\HttpFoundation\Cookie\$value.

Member Function Documentation

◆ __toString() [1/2]

◆ __toString() [2/2]

◆ create()

static Symfony\Component\HttpFoundation\Cookie::create ( string  $name,
string  $value = null,
  $expire = 0,
?string  $path = '/',
string  $domain = null,
bool  $secure = null,
bool  $httpOnly = true,
bool  $raw = false,
?string  $sameSite = self::SAMESITE_LAX 
)
static

◆ fromString() [1/2]

static Symfony\Component\HttpFoundation\Cookie::fromString (   $cookie,
  $decode = false 
)
static

◆ fromString() [2/2]

static Symfony\Component\HttpFoundation\Cookie::fromString (   $cookie,
  $decode = false 
)
static

◆ getDomain() [1/2]

◆ getDomain() [2/2]

Symfony\Component\HttpFoundation\Cookie::getDomain ( )

Gets the domain that the cookie is available to.

Returns
string|null

Definition at line 215 of file vendor/symfony/http-foundation/Cookie.php.

References Symfony\Component\HttpFoundation\Cookie\$domain.

◆ getExpiresTime() [1/2]

Symfony\Component\HttpFoundation\Cookie::getExpiresTime ( )

Gets the time the cookie expires.

Returns
int

Definition at line 217 of file lib/vendor/symfony/http-foundation/Cookie.php.

References Symfony\Component\HttpFoundation\Cookie\$expire.

Referenced by Symfony\Component\HttpFoundation\Cookie\__toString().

◆ getExpiresTime() [2/2]

Symfony\Component\HttpFoundation\Cookie::getExpiresTime ( )

Gets the time the cookie expires.

Returns
int

Definition at line 225 of file vendor/symfony/http-foundation/Cookie.php.

References Symfony\Component\HttpFoundation\Cookie\$expire.

◆ getMaxAge() [1/2]

Symfony\Component\HttpFoundation\Cookie::getMaxAge ( )

Gets the max-age attribute.

Returns
int

Definition at line 227 of file lib/vendor/symfony/http-foundation/Cookie.php.

Referenced by Symfony\Component\HttpFoundation\Cookie\__toString().

◆ getMaxAge() [2/2]

Symfony\Component\HttpFoundation\Cookie::getMaxAge ( )

Gets the max-age attribute.

Returns
int

Definition at line 235 of file vendor/symfony/http-foundation/Cookie.php.

◆ getName() [1/2]

◆ getName() [2/2]

Symfony\Component\HttpFoundation\Cookie::getName ( )

Gets the name of the cookie.

Returns
string

Definition at line 195 of file vendor/symfony/http-foundation/Cookie.php.

References Symfony\Component\HttpFoundation\Cookie\$name.

◆ getPath() [1/2]

Symfony\Component\HttpFoundation\Cookie::getPath ( )

◆ getPath() [2/2]

Symfony\Component\HttpFoundation\Cookie::getPath ( )

Gets the path on the server in which the cookie will be available on.

Returns
string

Definition at line 247 of file vendor/symfony/http-foundation/Cookie.php.

References Symfony\Component\HttpFoundation\Cookie\$path.

◆ getSameSite() [1/2]

Symfony\Component\HttpFoundation\Cookie::getSameSite ( )

Gets the SameSite attribute.

Returns
string|null

Definition at line 287 of file lib/vendor/symfony/http-foundation/Cookie.php.

Referenced by Symfony\Component\HttpFoundation\Cookie\__toString().

◆ getSameSite() [2/2]

Symfony\Component\HttpFoundation\Cookie::getSameSite ( )

Gets the SameSite attribute.

Returns
string|null

Definition at line 297 of file vendor/symfony/http-foundation/Cookie.php.

◆ getValue() [1/2]

Symfony\Component\HttpFoundation\Cookie::getValue ( )

Gets the value of the cookie.

Returns
string|null

Definition at line 197 of file lib/vendor/symfony/http-foundation/Cookie.php.

References Symfony\Component\HttpFoundation\Cookie\$value.

Referenced by Symfony\Component\HttpFoundation\Cookie\__toString().

◆ getValue() [2/2]

Symfony\Component\HttpFoundation\Cookie::getValue ( )

Gets the value of the cookie.

Returns
string|null

Definition at line 205 of file vendor/symfony/http-foundation/Cookie.php.

References Symfony\Component\HttpFoundation\Cookie\$value.

◆ isCleared() [1/2]

Symfony\Component\HttpFoundation\Cookie::isCleared ( )

Whether this cookie is about to be cleared.

Returns
bool

Definition at line 267 of file lib/vendor/symfony/http-foundation/Cookie.php.

◆ isCleared() [2/2]

Symfony\Component\HttpFoundation\Cookie::isCleared ( )

Whether this cookie is about to be cleared.

Returns
bool

Definition at line 277 of file vendor/symfony/http-foundation/Cookie.php.

◆ isHttpOnly() [1/2]

Symfony\Component\HttpFoundation\Cookie::isHttpOnly ( )

Checks whether the cookie will be made accessible only through the HTTP protocol.

Returns
bool

Definition at line 257 of file lib/vendor/symfony/http-foundation/Cookie.php.

References Symfony\Component\HttpFoundation\Cookie\$httpOnly.

Referenced by Symfony\Component\HttpFoundation\Cookie\__toString().

◆ isHttpOnly() [2/2]

Symfony\Component\HttpFoundation\Cookie::isHttpOnly ( )

Checks whether the cookie will be made accessible only through the HTTP protocol.

Returns
bool

Definition at line 267 of file vendor/symfony/http-foundation/Cookie.php.

References Symfony\Component\HttpFoundation\Cookie\$httpOnly.

◆ isRaw() [1/2]

Symfony\Component\HttpFoundation\Cookie::isRaw ( )

Checks if the cookie value should be sent with no url encoding.

Returns
bool

Definition at line 277 of file lib/vendor/symfony/http-foundation/Cookie.php.

Referenced by Symfony\Component\HttpFoundation\Cookie\__toString().

◆ isRaw() [2/2]

Symfony\Component\HttpFoundation\Cookie::isRaw ( )

Checks if the cookie value should be sent with no url encoding.

Returns
bool

Definition at line 287 of file vendor/symfony/http-foundation/Cookie.php.

◆ isSecure() [1/2]

Symfony\Component\HttpFoundation\Cookie::isSecure ( )

Checks whether the cookie should only be transmitted over a secure HTTPS connection from the client.

Returns
bool

Definition at line 247 of file lib/vendor/symfony/http-foundation/Cookie.php.

References Symfony\Component\HttpFoundation\Cookie\$secure.

Referenced by Symfony\Component\HttpFoundation\Cookie\__toString().

◆ isSecure() [2/2]

Symfony\Component\HttpFoundation\Cookie::isSecure ( )

Checks whether the cookie should only be transmitted over a secure HTTPS connection from the client.

Returns
bool

Definition at line 257 of file vendor/symfony/http-foundation/Cookie.php.

◆ setSecureDefault()

Symfony\Component\HttpFoundation\Cookie::setSecureDefault ( bool  $default)
Parameters
bool$defaultThe default value of the "secure" flag when it is set to null

Definition at line 305 of file vendor/symfony/http-foundation/Cookie.php.

Field Documentation

◆ $domain

◆ $expire

◆ $httpOnly

◆ $name

◆ $path

◆ $secure

◆ $value

◆ SAMESITE_LAX

const Symfony\Component\HttpFoundation\Cookie::SAMESITE_LAX = 'lax'

◆ SAMESITE_NONE

const Symfony\Component\HttpFoundation\Cookie::SAMESITE_NONE = 'none'

Definition at line 21 of file vendor/symfony/http-foundation/Cookie.php.

◆ SAMESITE_STRICT

const Symfony\Component\HttpFoundation\Cookie::SAMESITE_STRICT = 'strict'

The documentation for this class was generated from the following file: