Overview

Namespaces

  • Baguette
    • Mastodon
      • Config
      • Entity
      • Grant
      • Service
  • GuzzleHttp
    • Cookie
    • Exception
    • Handler
    • Promise
  • Psr
    • Http
      • Message
  • Teto
    • Object

Classes

  • CookieJar
  • FileCookieJar
  • SessionCookieJar
  • SetCookie

Interfaces

  • CookieJarInterface
  • Overview
  • Namespace
  • Class

Class SetCookie

Set-Cookie object

Namespace: GuzzleHttp\Cookie
Located at Cookie/SetCookie.php
Methods summary
public static GuzzleHttp\Cookie\SetCookie
# fromString( string $cookie )

Create a new SetCookie object from a string

Create a new SetCookie object from a string

Parameters

$cookie
Set-Cookie header string

Returns

GuzzleHttp\Cookie\SetCookie
public
# __construct( array $data = [] )

Parameters

$data
Array of cookie data provided by a Cookie parser
public
# __toString( )
public
# toArray( )
public string
# getName( )

Get the cookie name

Get the cookie name

Returns

string
public
# setName( string $name )

Set the cookie name

Set the cookie name

Parameters

$name
Cookie name
public string
# getValue( )

Get the cookie value

Get the cookie value

Returns

string
public
# setValue( string $value )

Set the cookie value

Set the cookie value

Parameters

$value
Cookie value
public string|null
# getDomain( )

Get the domain

Get the domain

Returns

string|null
public
# setDomain( string $domain )

Set the domain of the cookie

Set the domain of the cookie

Parameters

$domain
public string
# getPath( )

Get the path

Get the path

Returns

string
public
# setPath( string $path )

Set the path of the cookie

Set the path of the cookie

Parameters

$path
Path of the cookie
public integer|null
# getMaxAge( )

Maximum lifetime of the cookie in seconds

Maximum lifetime of the cookie in seconds

Returns

integer|null
public
# setMaxAge( integer $maxAge )

Set the max-age of the cookie

Set the max-age of the cookie

Parameters

$maxAge
Max age of the cookie in seconds
public mixed
# getExpires( )

The UNIX timestamp when the cookie Expires

The UNIX timestamp when the cookie Expires

Returns

mixed
public
# setExpires( integer $timestamp )

Set the unix timestamp for which the cookie will expire

Set the unix timestamp for which the cookie will expire

Parameters

$timestamp
Unix timestamp
public null|boolean
# getSecure( )

Get whether or not this is a secure cookie

Get whether or not this is a secure cookie

Returns

null|boolean
public
# setSecure( boolean $secure )

Set whether or not the cookie is secure

Set whether or not the cookie is secure

Parameters

$secure
Set to true or false if secure
public null|boolean
# getDiscard( )

Get whether or not this is a session cookie

Get whether or not this is a session cookie

Returns

null|boolean
public
# setDiscard( boolean $discard )

Set whether or not this is a session cookie

Set whether or not this is a session cookie

Parameters

$discard
Set to true or false if this is a session cookie
public boolean
# getHttpOnly( )

Get whether or not this is an HTTP only cookie

Get whether or not this is an HTTP only cookie

Returns

boolean
public
# setHttpOnly( boolean $httpOnly )

Set whether or not this is an HTTP only cookie

Set whether or not this is an HTTP only cookie

Parameters

$httpOnly
Set to true or false if this is HTTP only
public boolean
# matchesPath( string $requestPath )

Check if the cookie matches a path value.

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

$requestPath
Path to check against

Returns

boolean
public boolean
# matchesDomain( string $domain )

Check if the cookie matches a domain value

Check if the cookie matches a domain value

Parameters

$domain
Domain to check against

Returns

boolean
public boolean
# isExpired( )

Check if the cookie is expired

Check if the cookie is expired

Returns

boolean
public boolean|string
# validate( )

Check if the cookie is valid according to RFC 6265

Check if the cookie is valid according to RFC 6265

Returns

boolean|string
Returns true if valid or an error message if invalid
ξ ^ω^)ξ Baguette PHP Mastodon API Client / SDK API documentation generated by ApiGen