Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
GuzzleHttp\Cookie\SetCookie Class Reference

Public Member Functions

 __construct (array $data=[])
 
 __toString ()
 
 getDiscard ()
 Get whether or not this is a session cookie.
 
 getDomain ()
 Get the domain.
 
 getExpires ()
 The UNIX timestamp when the cookie Expires.
 
 getHttpOnly ()
 Get whether or not this is an HTTP only cookie.
 
 getMaxAge ()
 Maximum lifetime of the cookie in seconds.
 
 getName ()
 Get the cookie name.
 
 getPath ()
 Get the path.
 
 getSecure ()
 Get whether or not this is a secure cookie.
 
 getValue ()
 Get the cookie value.
 
 isExpired ()
 Check if the cookie is expired.
 
 matchesDomain (string $domain)
 Check if the cookie matches a domain value.
 
 matchesPath (string $requestPath)
 Check if the cookie matches a path value.
 
 setDiscard ($discard)
 Set whether or not this is a session cookie.
 
 setDomain ($domain)
 Set the domain of the cookie.
 
 setExpires ($timestamp)
 Set the unix timestamp for which the cookie will expire.
 
 setHttpOnly ($httpOnly)
 Set whether or not this is an HTTP only cookie.
 
 setMaxAge ($maxAge)
 Set the max-age of the cookie.
 
 setName ($name)
 Set the cookie name.
 
 setPath ($path)
 Set the path of the cookie.
 
 setSecure ($secure)
 Set whether or not the cookie is secure.
 
 setValue ($value)
 Set the cookie value.
 
 toArray ()
 
 validate ()
 Check if the cookie is valid according to RFC 6265.
 

Static Public Member Functions

static fromString (string $cookie)
 Create a new SetCookie object from a string.
 

Constructor & Destructor Documentation

◆ __construct()

GuzzleHttp\Cookie\SetCookie::__construct ( array $data = [])
Parameters
array$dataArray of cookie data provided by a Cookie parser

Member Function Documentation

◆ fromString()

static GuzzleHttp\Cookie\SetCookie::fromString ( string $cookie)
static

Create a new SetCookie object from a string.

Parameters
string$cookieSet-Cookie header string

◆ getDiscard()

GuzzleHttp\Cookie\SetCookie::getDiscard ( )

Get whether or not this is a session cookie.

Return values
bool|null

◆ getDomain()

GuzzleHttp\Cookie\SetCookie::getDomain ( )

Get the domain.

Return values
string|null

◆ getExpires()

GuzzleHttp\Cookie\SetCookie::getExpires ( )

The UNIX timestamp when the cookie Expires.

Return values
string|int|null

◆ getHttpOnly()

GuzzleHttp\Cookie\SetCookie::getHttpOnly ( )

Get whether or not this is an HTTP only cookie.

Return values
bool

◆ getMaxAge()

GuzzleHttp\Cookie\SetCookie::getMaxAge ( )

Maximum lifetime of the cookie in seconds.

Return values
int|null

◆ getName()

GuzzleHttp\Cookie\SetCookie::getName ( )

Get the cookie name.

Return values
string

◆ getPath()

GuzzleHttp\Cookie\SetCookie::getPath ( )

Get the path.

Return values
string

◆ getSecure()

GuzzleHttp\Cookie\SetCookie::getSecure ( )

Get whether or not this is a secure cookie.

Return values
bool

◆ getValue()

GuzzleHttp\Cookie\SetCookie::getValue ( )

Get the cookie value.

Return values
string|null

◆ matchesDomain()

GuzzleHttp\Cookie\SetCookie::matchesDomain ( string $domain)

Check if the cookie matches a domain value.

Parameters
string$domainDomain to check against

◆ matchesPath()

GuzzleHttp\Cookie\SetCookie::matchesPath ( string $requestPath)

Check if the cookie matches a path value.

A request-path path-matches a given cookie-path if at least one of the following conditions holds:

  • The cookie-path and the request-path are identical.
  • The cookie-path is a prefix of the request-path, and the last character of the cookie-path is x2F ("/").
  • The cookie-path is a prefix of the request-path, and the first character of the request-path that is not included in the cookie- path is a x2F ("/") character.
Parameters
string$requestPathPath to check against

◆ setDiscard()

GuzzleHttp\Cookie\SetCookie::setDiscard ( $discard)

Set whether or not this is a session cookie.

Parameters
bool$discardSet to true or false if this is a session cookie

◆ setDomain()

GuzzleHttp\Cookie\SetCookie::setDomain ( $domain)

Set the domain of the cookie.

Parameters
string | null$domain

◆ setExpires()

GuzzleHttp\Cookie\SetCookie::setExpires ( $timestamp)

Set the unix timestamp for which the cookie will expire.

Parameters
int | string | null$timestampUnix timestamp or any English textual datetime description.

◆ setHttpOnly()

GuzzleHttp\Cookie\SetCookie::setHttpOnly ( $httpOnly)

Set whether or not this is an HTTP only cookie.

Parameters
bool$httpOnlySet to true or false if this is HTTP only

◆ setMaxAge()

GuzzleHttp\Cookie\SetCookie::setMaxAge ( $maxAge)

Set the max-age of the cookie.

Parameters
int | null$maxAgeMax age of the cookie in seconds

◆ setName()

GuzzleHttp\Cookie\SetCookie::setName ( $name)

Set the cookie name.

Parameters
string$nameCookie name

◆ setPath()

GuzzleHttp\Cookie\SetCookie::setPath ( $path)

Set the path of the cookie.

Parameters
string$pathPath of the cookie

◆ setSecure()

GuzzleHttp\Cookie\SetCookie::setSecure ( $secure)

Set whether or not the cookie is secure.

Parameters
bool$secureSet to true or false if secure

◆ setValue()

GuzzleHttp\Cookie\SetCookie::setValue ( $value)

Set the cookie value.

Parameters
string$valueCookie value

◆ validate()

GuzzleHttp\Cookie\SetCookie::validate ( )

Check if the cookie is valid according to RFC 6265.

Return values
bool|stringReturns true if valid or an error message if invalid

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