Cookies
class Cookies implements Countable, IteratorAggregate
Cookies.
Properties
protected array | $defaults | Default options. | |
protected array | $cookies | Cookies. | |
protected Signer | $signer | Signer instance. |
Methods
int
count()
Returns the numner of cookies.
getIterator()
Retruns an array iterator object.
setOptions(array $defaults)
Set default options values.
add(string $name, string $value, int $ttl = 0, array $options = [], bool $raw = false)
Adds a unsigned cookie.
addRaw(string $name, string $value, int $ttl = 0, array $options = [])
Adds a raw unsigned cookie.
addSigned(string $name, string $value, int $ttl = 0, array $options = [], bool $raw = false)
Adds a signed cookie.
addRawSigned(string $name, string $value, int $ttl, array $options = [])
Adds a raw signed cookie.
bool
has(string $name)
Returns TRUE if the cookie exists and FALSE if not.
array
all()
Returns all the cookies.
Details
at line 57
__construct(Signer|null $signer = null)
Constructor.
at line 67
int
count()
Returns the numner of cookies.
at line 77
ArrayIterator
getIterator()
Retruns an array iterator object.
at line 88
Cookies
setOptions(array $defaults)
Set default options values.
at line 105
Cookies
add(string $name, string $value, int $ttl = 0, array $options = [], bool $raw = false)
Adds a unsigned cookie.
at line 129
Cookies
addRaw(string $name, string $value, int $ttl = 0, array $options = [])
Adds a raw unsigned cookie.
at line 144
Cookies
addSigned(string $name, string $value, int $ttl = 0, array $options = [], bool $raw = false)
Adds a signed cookie.
at line 163
Cookies
addRawSigned(string $name, string $value, int $ttl, array $options = [])
Adds a raw signed cookie.
at line 174
bool
has(string $name)
Returns TRUE if the cookie exists and FALSE if not.
at line 185
Cookies
remove(string $name)
Removes a cookie.
at line 199
Cookies
delete(string $name, array $options = [])
Deletes a cookie.
at line 211
Cookies
clear()
Clears all the cookies.
at line 223
array
all()
Returns all the cookies.