Promokit Posted May 2, 2020 Share Posted May 2, 2020 Hi, guys. I'm trying to set cookie correctly with javascript to be able to get it from Context::getContext()→cookies variable. I have tried external jQuery solution as well as built-in library /js/jquery/plugins/jquery.cooki-plugin.js Cookies always set correctly and available in browser's console and through $_COOKIE variable in php as well. But as you should know, that is not a Prestashop way to get cookies directly, and I have to use context. Unfortunately, my cookie is not available through context. So the question is: How to set cookie to make it available in context? Thanks in advance for suggestions! Link to comment Share on other sites More sharing options...
Promokit Posted May 5, 2020 Author Share Posted May 5, 2020 Any suggestions? Link to comment Share on other sites More sharing options...
Promokit Posted May 6, 2020 Author Share Posted May 6, 2020 Where are Prestashop developers? What is this forum for? Link to comment Share on other sites More sharing options...
razaro Posted May 6, 2020 Share Posted May 6, 2020 Hey Marek So if I understood, if you create custom cookie in JavaScript you can not call it in PHP with $this->context->cookie->__get('custom_cookie_name'); as it needs to be created with Context class ? Could you then use Ajax to create cookie in JavaScript but that Ajax call would create cookie with Context in PHP ? Link to comment Share on other sites More sharing options...
Promokit Posted May 6, 2020 Author Share Posted May 6, 2020 That's an idea, I didn't try. Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now