Reputation: 719
My frontend is setting a cookie that is sent with all requests. However, after our recent 4.0->4.2 laravel upgrade, the cookies can no longer be found by any method other than $_COOKIE["cookieName"]. I've tried Request::cookie(), Cookie::get(), and Input::cookie(). None return a value. I debugged the code and saw that in the request object, all of my cookies are set, but with no value. So there is a map of cookie names with null values.
Upvotes: 2
Views: 467
Reputation: 719
Found my issue finally. Laravel assumes all cookies are encrypted by its own algorithm. When it tries to decrypt and gets an exception (because it is not encrypted) it sets the key's value to null. The ability to disable encryption for certain cookies was added in laravel 5 here. I will just continue to use the PHP global.
Upvotes: 1