SecureCookie
class SecureCookie extends EncryptedCookie (View source)
AES-encrypted cookie using client-specific key
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
Encrypted cookie constructor
Set value of cookie
Set if the cookie should be transmitted only via https
Set if cookie should be available only to HTTP protocol
Static method to quickly create a cookie
Static method to quickly get a cookie
Create a client-specific key using provided key, the client remote address and (in case) the value of HTTP_X_FORWARDED_FOR header
Details
in EncryptedCookie at line 44
__construct(string $name, string $key, int $max_cookie_size = null)
Encrypted cookie constructor
Setup cookie name and key
in AbstractCookie at line 114
CookieInterface
setName(string $name)
Set cookie name
in AbstractCookie at line 127
string
getName()
Get cookie name
in EncryptedCookie at line 55
CookieInterface
setValue(string $value, bool $serialize = true)
Set value of cookie
in EncryptedCookie at line 82
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
in EncryptedCookie at line 118
static EncryptedCookie
create($name, $key, array $properties = [], $serialize = true)
Static method to quickly create a cookie
in EncryptedCookie at line 149
static EncryptedCookie
retrieve(string $name, string $key)
Static method to quickly get a cookie
at line 32
static protected string
encryptKey(string $key)
Create a client-specific key using provided key, the client remote address and (in case) the value of HTTP_X_FORWARDED_FOR header