Cookies

Cookies are a very useful way to store small pieces of data on the client's machine which will be kept there even if the browser closed.

Quantum comes with simple `Cookie` library which has all the ncessary methods that helps you to manage cookies.
By default, cookies are automatically encoded and decoded with base64_encode() and base64_decode() functions, but you are free to use more advanced encryption/decription functions instead.

Retrieving cookie data by given key


$data = Cookie::get($key);

        

Retrieving all cookie data


$data = Cookie::all();

        

Checking if cookie contains data with given key, which returns true or false


Cookie::has($key);

        

Storing data in the cookie. Check all the arguments in the PHP documentation setcookie section.


Cookie::set($key, $value = '', $time = 0, $path = '/', $domain = '', $secure = FALSE, $httponly = FALSE);

        

Deleting data from cookie by given key


Cookie::delete($key, $path = '/');

        

Deleting whole cookie data


Cookie::flush();

        
<< Prev Next >>