3 namespace Zumba\GastonJS;
7 * @package Zumba\GastonJS
11 protected $attributes;
16 public function __construct($attributes) {
17 $this->attributes = $attributes;
21 * Returns the cookie name
24 public function getName() {
25 return $this->attributes['name'];
29 * Returns the cookie value
32 public function getValue() {
33 return urldecode($this->attributes['value']);
37 * Returns the cookie domain
40 public function getDomain() {
41 return $this->attributes['domain'];
45 * Returns the path were the cookie is valid
48 public function getPath() {
49 return $this->attributes['path'];
56 public function isSecure() {
57 return isset($this->attributes['secure']);
61 * Is http only cookie?
64 public function isHttpOnly() {
65 return isset($this->attributes['httponly']);
69 * Returns cookie expiration time
72 public function getExpirationTime() {
73 //TODO: return a \DateTime object
74 if (isset($this->attributes['expiry'])) {
75 return $this->attributes['expiry'];