The Cookie Helper record contains capacities that help with working with treats.
- Loading this Helper
- Available Functions
Loading this Helper
This assistant is stacked utilizing the accompanying code:
The accompanying capacities are accessible:
set_cookie($name[, $value = ''[, $expire = ''[, $domain = ''[, $path = '/'[, $prefix = ''[, $secure = false[, $httpOnly = false]]]]]]])
- $name(mixed) –Cookie name or affiliated exhibit of the entirety of the parameters accessible to this capacity
- $value(string)–Cookie esteem
- $expire(int)– Number of seconds until termination
- $domain(string)–Cookie space (generally: .yourdomain.com)
- $path(string)– Cookie way
- $prefix(string)– Cookie name prefix
- $secure(bool)– Whether to just send the treat through HTTPS
This aide work gives you more amiable grammar to set program treats. Allude to the Response Library for a depiction of its utilization, as this capacity is an assumed name for Response::setCookie().
get_cookie($index[, $xssClean = false])
- $index (string) – Cookie name
- $xss_clean (bool) – Whether to apply XSS sifting to the brought an incentive back
- The treat worth or NULL if not found
This assistant capacity gives you more amicable linguistic structure to get program treats. Allude to the IncomingRequest Library for point by point portrayal of its utilization, as this capacity demonstrations correspondingly to IncomingRequest::getCookie(), with the exception of it will likewise prepend the $cookiePrefix that you might've set in your application/Config/App.php record.
delete_cookie($name[, $domain = ''[, $path = '/'[, $prefix = '']]])
- $name (string) – Cookie name
- $domain (string) – Cookie space (for the most part: .yourdomain.com)
- $path (string) – Cookie way
- $prefix (string) – Cookie name prefix
Lets you erase a treat. Except if you've set a custom way or different qualities, just the name of the treat is required.
This capacity is in any case indistinguishable from set_cookie(), then again, actually it doesn't have the worth and termination parameters. You can present a variety of qualities in the main parameter or you can set discrete parameters.
delete_cookie($name, $domain, $path, $prefix);