Cookie (Component\BrowserKit)
Symfony\Component\BrowserKit\Cookie
class Cookie
Cookie represents an HTTP cookie.
Methods
__construct(string $name, string $value, string $expires = null, string $path = null, string $domain = '', bool $secure = false, bool $httponly = true, bool $encodedValue = false) Sets a cookie. | ||
string | __toString() Returns the HTTP representation of the Cookie. | |
static Cookie | fromString(string $cookie, string $url = null) Creates a Cookie instance from a Set-Cookie header value. | |
string | getName() Gets the name of the cookie. | |
string | getValue() Gets the value of the cookie. | |
string | getRawValue() Gets the raw value of the cookie. | |
string | getExpiresTime() Gets the expires time of the cookie. | |
string | getPath() Gets the path of the cookie. | |
string | getDomain() Gets the domain of the cookie. | |
bool | isSecure() Returns the secure flag of the cookie. | |
bool | isHttpOnly() Returns the httponly flag of the cookie. | |
bool | isExpired() Returns true if the cookie has expired. |
Details
public __construct(string $name, string $value, string $expires = null, string $path = null, string $domain = '', bool $secure = false, bool $httponly = true, bool $encodedValue = false)
Sets a cookie.
public string __toString()
Returns the HTTP representation of the Cookie.
static public Cookie fromString(string $cookie, string $url = null)
Creates a Cookie instance from a Set-Cookie header value.
public string getName()
Gets the name of the cookie.
public string getValue()
Gets the value of the cookie.
public string getRawValue()
Gets the raw value of the cookie.
public string getExpiresTime()
Gets the expires time of the cookie.
public string getPath()
Gets the path of the cookie.
public string getDomain()
Gets the domain of the cookie.
public bool isSecure()
Returns the secure flag of the cookie.
public bool isHttpOnly()
Returns the httponly flag of the cookie.
public bool isExpired()
Returns true if the cookie has expired.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Component/BrowserKit/Cookie.html