Cookie
class Cookie extends AbstractCookie (View source)
Plain cookie
Properties
protected string | $name | The cookie name | from AbstractCookie |
protected string | $value | Cookie value (native string or serialized one) | from AbstractCookie |
protected integer | $expire | Expiration time | from AbstractCookie |
protected string | $path | Path of cookie | from AbstractCookie |
protected string | $domain | Domain of cookie | from AbstractCookie |
protected bool | $secure | Secure flag | from AbstractCookie |
protected bool | $httponly | Httponly flag | from AbstractCookie |
protected | $max_cookie_size | from AbstractCookie |
Methods
__construct(string $name, int $max_cookie_size = null)
Default cookie's constructor
from AbstractCookie
setValue(string $value, bool $serialize = true)
Set value of cookie
string
getValue(bool $unserialize = true)
Get cookie value
setSecure(bool $mode = true)
Set if the cookie should be transmitted only via https
from AbstractCookie
setHttponly($mode = true)
Set if cookie should be available only to HTTP protocol
from AbstractCookie
Details
in AbstractCookie at line 91
__construct(string $name, int $max_cookie_size = null)
Default cookie's constructor
in AbstractCookie at line 114
CookieInterface
setName(string $name)
Set cookie name
in AbstractCookie at line 127
string
getName()
Get cookie name
at line 28
CookieInterface
setValue(string $value, bool $serialize = true)
Set value of cookie
at line 45
string
getValue(bool $unserialize = true)
Get cookie value
in AbstractCookie at line 146
CookieInterface
setExpire($timestamp)
Set cookie's expiration time
in AbstractCookie at line 159
CookieInterface
setPath(string $location)
Set cookie's path
in AbstractCookie at line 172
CookieInterface
setDomain(string $domain)
Set cookie's domain
in AbstractCookie at line 185
CookieInterface
setSecure(bool $mode = true)
Set if the cookie should be transmitted only via https
in AbstractCookie at line 196
CookieInterface
setHttponly($mode = true)
Set if cookie should be available only to HTTP protocol
in AbstractCookie at line 207
boolean
save()
Set cookie
in AbstractCookie at line 226
CookieInterface
load()
Get cookie
in AbstractCookie at line 239
bool
delete()
Delete cookie
in AbstractCookie at line 260
bool
exists()
Check if cookie exists
in AbstractCookie at line 275
static boolean
erase(string $name)
Static method to quickly delete a cookie