Login +

Reference Guide / SLS_Cookie

SLS_Cookie1 is a class that allows you to manipulate data stored in cookies.

Accessibility

At Controller level, you can instantiate a new class:

$cookie = new SLS_Cookie();

Data recovery

- If you want to retrieve all the parameters, you can use the getParams() function:

$this->_cookie->getParams();

- If you want to retrieve a particular parameter, you can use the __get() function:

$this->_cookie->__get($param);

Data updates

- If you want to change the value of a key, use the __set() function:

$this->_cookie->__set($key, $value);

- If you want to delete a key, use the flush() function:

$this->_cookie->flush($key);

- To reflect data in the cookie, use the save() function:

$this->_cookie->save();

- To delete the whole cookie, use the delete() function:

$this->_cookie->delete();

References

  1. SLS_Cookie - SLS_Cookie class - Manage cookie