How would i using Laravel make a cookie using Cookie::Make
(Or something else) and set the httponly property to false?
I would want to do this as the cookie contains a key which my JS must be able to read.
Laravel provides an option for this, but the docs don't show it. The best way is to look through the source. If you take a look at the CookieJar.php file here you'll see the httpOnly option.
public function make($name, $value, $minutes = 0, $path = null, $domain = null, $secure = false, $httpOnly = true)
so simply do something like:
Cookie::make('MyCookie', 'MyValue', 60, null, null, false, false);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With