jafakash cp Posted July 19, 2017 Share Posted July 19, 2017 hi, i have created an custom cookie variable like $context->cookie->line = $p_line; . now after completing my functionality i just need to unset this variable from context cookie . for deleting cookie variable in php we will do like unset($_COOKIE['mycookiename']); how this method can be apply to above context cookie. Looking forward to prestashop expertise reply. Thanks Jafakash cp 1 Link to comment Share on other sites More sharing options...
theillo Posted May 22, 2019 Share Posted May 22, 2019 To Set and unset a cookie variable: $this->context->cookie->__set($key,$value); $this->context->cookie->__unset($key); Also useful: $this->context->cookie->__isset($key); $this->context->cookie->__get($key); OR $this->context->cookie->key; And of course if $this->context is not set yet, first get it with $context = Context::getContext(); OR $this->context = Context::getContext(); 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