Answer the question
In order to leave comments, you need to log in
Cookie::get('') not working?
Laravel 5.4 Cookie facade:
{{ dD( cookie('my_cookie_name')) }}
Cookie {#618 ▼
#name: "my_cookie_name"
#value: null
#domain: null
#expire: 0
#path: "/"
#secure: false
#httpOnly: true
-raw: false
-sameSite: null
}
{{ dD(Request::cookie('my_cookie_name')) }}
{{ dD(Cookie::get('my_cookie_name')) }}
{{ dD($_COOKIE) }}
{{ dd($_COOKIE['my_cookie_name']) }} // работает
Answer the question
In order to leave comments, you need to log in
Check out the encryption keys.
By default, all cookies are encrypted and signed, your "1" is simply undecryptable and as a result => null.
============
Solutions:
1) Add to exceptions
2) Set cookies using lara, not directly from the browser.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question