I have set cookie with the jQuery Cookied plugin and when I try to access it with the PHP, then it is not working.
Cookie has been set with the following code :
$.cookie("_culture", culture, { expires: 365, path: '/' });
And I tried to get it with $_COOKIE['_culture']
but it is not working.
I am not able to find the reason. But I think its DIRECTORY RELATED issue.Because if I try to get it through the same directory, then it works perfectly.
But when I tried it from other directory, then it is not working.
How can I make it accessible in all the directories ?
(I checked cookies and the cookie what I want to retrieve is present there.)
You should add a domain so it will be accessible from your root & subdirectories.
$.cookie('_culture', culture, { expires: 365, path: '/', domain: 'example.com' });