I'm using laravel 5.6
and cookie to use data across pages.
In my first page N°1, I have a table with button like this :
<button data-href="/fractions/" data-lot="1" class="link m-portlet__nav-link btn m-btn m-btn--hover-brand m-btn--icon m-btn--icon-only m-btn--pill" title="Fractions">
<i class="la la-puzzle-piece"></i>
</button>
And I have a script attachi to .link :
$(document).on('click', '.link', function(e){
$.cookie("lot", $(this).data("lot"), { expires: 7 });
$(location).attr('href',$(this).data("href"));
});
On my second page N°2 (data-href), I use :
{{ Cookie::get('lot') }}
But nothing shows up. I looked inside chrome console and I can see my cookie.
I try to debug on the controller side but it doesn't see the cookie too.
What's weird is that I use the same system at the beginning of my site (page N°0) and on page N°2 I can access to the cookie I create on page N°0.
So why I can access all cookies?
Thank for your help.