Jump to content

Unable to get cookie value in PrestaShop Context::getContext()->cookie


Recommended Posts

Unable to get cookie value in PrestaShop Context::getContext()->cookie, however, it shows in $_COOKIE?

I am creating a module in which I use a third party JS. The JS creates a cookie in the browser. At the backend, I want to read that cookie with the help of PrestaShop cookie class (Context::getContext()->cookie / $this->context->cookie ) but I am unable to get it, whereas, if I use php default $_COOKIE, it works fine.

For instance, if the cookie key is xyz and the value is 123456abc, when I use print_r($_COOKIE), it prints [xyz]= "123456abc", but when I use PrestaShop cookie, it doesn't print anything.

Link to comment
Share on other sites

Hello:

It seems that your third party JS does not set the Prestashop cookie (which is specially encrypted by PS by the way) but set its own cookie. There is nothing you can do about it :( but using $_COOKIE var.

Regards

  • Sad 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...