class Cookie in Zircon Profile 8.0
Same name in this branch
- 8.0 vendor/symfony/http-foundation/Cookie.php \Symfony\Component\HttpFoundation\Cookie
- 8.0 vendor/symfony/browser-kit/Cookie.php \Symfony\Component\BrowserKit\Cookie
- 8.0 vendor/jcalderonzumba/gastonjs/src/Cookie.php \Zumba\GastonJS\Cookie
- 8.0 core/modules/user/src/Authentication/Provider/Cookie.php \Drupal\user\Authentication\Provider\Cookie
Same name and namespace in other branches
- 8 vendor/jcalderonzumba/gastonjs/src/Cookie.php \Zumba\GastonJS\Cookie
Class Cookie @package Zumba\GastonJS
Hierarchy
- class \Zumba\GastonJS\Cookie
Expanded class hierarchy of Cookie
2 files declare their use of Cookie
- BrowserCookieTrait.php in vendor/
jcalderonzumba/ gastonjs/ src/ Browser/ BrowserCookieTrait.php - CookieTrait.php in vendor/
jcalderonzumba/ mink-phantomjs-driver/ src/ CookieTrait.php
7 string references to 'Cookie'
- ClientTest::testUsesCookies in vendor/
fabpot/ goutte/ Goutte/ Tests/ ClientTest.php - ClientTest::testUsesCookiesWithCustomPort in vendor/
fabpot/ goutte/ Goutte/ Tests/ ClientTest.php - CookieJar::withCookieHeader in vendor/
guzzlehttp/ guzzle/ src/ Cookie/ CookieJar.php - Create a request with added cookie headers.
- FinishResponseSubscriber::setResponseCacheable in core/
lib/ Drupal/ Core/ EventSubscriber/ FinishResponseSubscriber.php - Add Cache-Control and Expires headers to a cacheable response.
- HttpCache::__construct in vendor/
symfony/ http-kernel/ HttpCache/ HttpCache.php - Constructor.
File
- vendor/
jcalderonzumba/ gastonjs/ src/ Cookie.php, line 9
Namespace
Zumba\GastonJSView source
class Cookie {
/** @var array */
protected $attributes;
/**
* @param $attributes
*/
public function __construct($attributes) {
$this->attributes = $attributes;
}
/**
* Returns the cookie name
* @return string
*/
public function getName() {
return $this->attributes['name'];
}
/**
* Returns the cookie value
* @return string
*/
public function getValue() {
return urldecode($this->attributes['value']);
}
/**
* Returns the cookie domain
* @return string
*/
public function getDomain() {
return $this->attributes['domain'];
}
/**
* Returns the path were the cookie is valid
* @return string
*/
public function getPath() {
return $this->attributes['path'];
}
/**
* Is a secure cookie?
* @return bool
*/
public function isSecure() {
return isset($this->attributes['secure']);
}
/**
* Is http only cookie?
* @return bool
*/
public function isHttpOnly() {
return isset($this->attributes['httponly']);
}
/**
* Returns cookie expiration time
* @return mixed
*/
public function getExpirationTime() {
//TODO: return a \DateTime object
if (isset($this->attributes['expiry'])) {
return $this->attributes['expiry'];
}
return null;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Cookie:: |
protected | property | @var array | |
Cookie:: |
public | function | Returns the cookie domain | |
Cookie:: |
public | function | Returns cookie expiration time | |
Cookie:: |
public | function | Returns the cookie name | |
Cookie:: |
public | function | Returns the path were the cookie is valid | |
Cookie:: |
public | function | Returns the cookie value | |
Cookie:: |
public | function | Is http only cookie? | |
Cookie:: |
public | function | Is a secure cookie? | |
Cookie:: |
public | function |