This cookie manager obfuscates all keys and signs via SHA1 the values On get, if the attached signature does not match the generated signature, no value is returned.
| since | 2.3 |
|---|---|
| package |
CMS |
| licwnse |
2.3 |
| author |
Robert Campbell |
get_key(string $key)
The cookie name is encoded to be obfuscated to minimize the opportunity of attacks.
string $keyThe cookie name
get(string $okey) : string|null
This method will retrieve the value of the cookie by first obfuscating the cookie name. Then ensuring that the signature of retrieved cookie can be verified.
string $okeyThe cookie name
string|null
set(string $okey, string $value, integer $expires) : boolean
This method will first obfuscate the cookie name. Then it will generate a signature for the cookie contents, then append it to the cookie value. Then generate a standard cookie.
string $okeyThe input cookie name
string $valueThe cookie value.
integer $expiresThe expiry timestamp of the cookie. A value of 0 indicates that a session cookie should be created.
boolean
true on success
exists(string $key) : boolean
This method will obfuscate the input cookie name.
string $keyThe input cookie name.
boolean
erase(string $key)
This method will obfuscate the input cookie name.
string $keyThe input cookie name.