Open Journal Systems  3.3.0
Http\Message\Cookie Class Reference

Public Member Functions

 __construct ( $name, $value=null, $maxAge=null, $domain=null, $path=null, $secure=false, $httpOnly=false, \DateTime $expires=null)
 
 getDomain ()
 
 getExpires ()
 
 getMaxAge ()
 
 getName ()
 
 getPath ()
 
 getValue ()
 
 hasDomain ()
 
 hasExpires ()
 
 hasMaxAge ()
 
 hasValue ()
 
 isExpired ()
 
 isHttpOnly ()
 
 isSecure ()
 
 isValid ()
 
 match (self $cookie)
 
 matchDomain ($domain)
 
 matchPath ($path)
 
 withDomain ($domain)
 
 withExpires (\DateTime $expires=null)
 
 withHttpOnly ($httpOnly)
 
 withMaxAge ($maxAge)
 
 withPath ($path)
 
 withSecure ($secure)
 
 withValue ($value)
 

Static Public Member Functions

static createWithoutValidation ( $name, $value=null, $maxAge=null, $domain=null, $path=null, $secure=false, $httpOnly=false, \DateTime $expires=null)
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

Http\Message\Cookie::__construct (   $name,
  $value = null,
  $maxAge = null,
  $domain = null,
  $path = null,
  $secure = false,
  $httpOnly = false,
\DateTime  $expires = null 
)
Parameters
string$name
string | null$value
int | null$maxAge
string | null$domain
string | null$path
bool$secure
bool$httpOnly
\DateTime | null$expiresExpires attribute is HTTP 1.0 only and should be avoided.
Exceptions

Definition at line 92 of file vendor/php-http/message/src/Cookie.php.

Member Function Documentation

◆ createWithoutValidation()

static Http\Message\Cookie::createWithoutValidation (   $name,
  $value = null,
  $maxAge = null,
  $domain = null,
  $path = null,
  $secure = false,
  $httpOnly = false,
\DateTime  $expires = null 
)
static

Creates a new cookie without any attribute validation.

Parameters
string$name
string | null$value
int$maxAge
string | null$domain
string | null$path
bool$secure
bool$httpOnly
\DateTime | null$expiresExpires attribute is HTTP 1.0 only and should be avoided.

Definition at line 128 of file vendor/php-http/message/src/Cookie.php.

◆ getDomain()

Http\Message\Cookie::getDomain ( )

Returns the domain.

Returns
string|null

Definition at line 280 of file vendor/php-http/message/src/Cookie.php.

◆ getExpires()

Http\Message\Cookie::getExpires ( )

Returns the expiration time.

Returns
\DateTime|null

Definition at line 235 of file vendor/php-http/message/src/Cookie.php.

◆ getMaxAge()

Http\Message\Cookie::getMaxAge ( )

Returns the max age.

Returns
int|null

Definition at line 198 of file vendor/php-http/message/src/Cookie.php.

Referenced by Http\Message\CookieJar\addCookie().

◆ getName()

Http\Message\Cookie::getName ( )

Returns the name.

Returns
string

Definition at line 151 of file vendor/php-http/message/src/Cookie.php.

◆ getPath()

Http\Message\Cookie::getPath ( )

Returns the path.

Returns
string

Definition at line 339 of file vendor/php-http/message/src/Cookie.php.

◆ getValue()

Http\Message\Cookie::getValue ( )

Returns the value.

Returns
string|null

Definition at line 161 of file vendor/php-http/message/src/Cookie.php.

Referenced by Http\Message\CookieJar\addCookie().

◆ hasDomain()

Http\Message\Cookie::hasDomain ( )

Checks if there is a domain.

Returns
bool

Definition at line 290 of file vendor/php-http/message/src/Cookie.php.

Referenced by Http\Message\Cookie\matchDomain().

◆ hasExpires()

Http\Message\Cookie::hasExpires ( )

Checks if there is an expiration time.

Returns
bool

Definition at line 245 of file vendor/php-http/message/src/Cookie.php.

◆ hasMaxAge()

Http\Message\Cookie::hasMaxAge ( )

Checks if there is a max age.

Returns
bool

Definition at line 208 of file vendor/php-http/message/src/Cookie.php.

◆ hasValue()

Http\Message\Cookie::hasValue ( )

Checks if there is a value.

Returns
bool

Definition at line 171 of file vendor/php-http/message/src/Cookie.php.

Referenced by Http\Message\CookieJar\addCookie().

◆ isExpired()

Http\Message\Cookie::isExpired ( )

Checks if the cookie is expired.

Returns
bool

Definition at line 270 of file vendor/php-http/message/src/Cookie.php.

◆ isHttpOnly()

Http\Message\Cookie::isHttpOnly ( )

Check whether this cookie may not be accessed through Javascript.

Returns
bool

Definition at line 403 of file vendor/php-http/message/src/Cookie.php.

◆ isSecure()

Http\Message\Cookie::isSecure ( )

Checks whether this cookie may only be sent over HTTPS.

Returns
bool

Definition at line 378 of file vendor/php-http/message/src/Cookie.php.

◆ isValid()

Http\Message\Cookie::isValid ( )

Validates cookie attributes.

Returns
bool

Definition at line 442 of file vendor/php-http/message/src/Cookie.php.

◆ match()

Http\Message\Cookie::match ( self  $cookie)

Checks if this cookie represents the same cookie as $cookie.

This does not compare the values, only name, domain and path.

Parameters
Cookie$cookie
Returns
bool

Definition at line 432 of file vendor/php-http/message/src/Cookie.php.

◆ matchDomain()

Http\Message\Cookie::matchDomain (   $domain)

Checks whether this cookie is meant for this domain.

See also
http://tools.ietf.org/html/rfc6265#section-5.1.3
Parameters
string$domain
Returns
bool

Definition at line 319 of file vendor/php-http/message/src/Cookie.php.

References Http\Message\Cookie\hasDomain().

◆ matchPath()

Http\Message\Cookie::matchPath (   $path)

Checks whether this cookie is meant for this path.

See also
http://tools.ietf.org/html/rfc6265#section-5.1.4
Parameters
string$path
Returns
bool

Definition at line 368 of file vendor/php-http/message/src/Cookie.php.

◆ withDomain()

Http\Message\Cookie::withDomain (   $domain)

Sets the domain.

Parameters
string | null$domain
Returns
Cookie

Definition at line 302 of file vendor/php-http/message/src/Cookie.php.

◆ withExpires()

Http\Message\Cookie::withExpires ( \DateTime  $expires = null)

Sets the expires.

Parameters
\DateTime | null$expires
Returns
Cookie

Definition at line 257 of file vendor/php-http/message/src/Cookie.php.

◆ withHttpOnly()

Http\Message\Cookie::withHttpOnly (   $httpOnly)

Sets whether this cookie may not be accessed through Javascript.

Parameters
bool$httpOnly
Returns
Cookie

Definition at line 415 of file vendor/php-http/message/src/Cookie.php.

◆ withMaxAge()

Http\Message\Cookie::withMaxAge (   $maxAge)

Sets the max age.

Parameters
int | null$maxAge
Returns
Cookie

Definition at line 220 of file vendor/php-http/message/src/Cookie.php.

◆ withPath()

Http\Message\Cookie::withPath (   $path)

Sets the path.

Parameters
string | null$path
Returns
Cookie

Definition at line 351 of file vendor/php-http/message/src/Cookie.php.

◆ withSecure()

Http\Message\Cookie::withSecure (   $secure)

Sets whether this cookie should only be sent over HTTPS.

Parameters
bool$secure
Returns
Cookie

Definition at line 390 of file vendor/php-http/message/src/Cookie.php.

◆ withValue()

Http\Message\Cookie::withValue (   $value)

Sets the value.

Parameters
string | null$value
Returns
Cookie

Definition at line 183 of file vendor/php-http/message/src/Cookie.php.


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