Support the ongoing development of Laravel.io →
posted 8 years ago
Requests

Hello, I am using https://github.com/carhartl/jquery-cookie for setting cookie and I want to get cookies in laravel environment. when I use Cookie::get() it return null but $_COOKIE return value. How can I fix this problem?

Last updated 3 years ago.
0

I think there is a problem with path which you are setting/default set while cookie is created. And this created cookie only be able display for same page only. So check and try this code

$.cookie('cookieName', 'Value', { path: '/' });

This should fix your cookie path problem. If still facing same, place code that you are using to create cookie.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

aghict aghict Joined 1 Apr 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.