Hi! I can store the cookie using following command successfully
$cookie=&$this->context->cookie;
$cookie->__set(íd', 'AAA');
echo $cookie->__get('íd');
However, I want set this cookie value expiry time to browser close, not want to change the cookie global time in admin -> preference -> default is 240 hours
I tried $cookie->setExpire(0); but it will show below error, seem setExpire cannot overload the global cookie. So what command can only set this value to expired when browser closed?
- in Cookie.php line 142
- at ErrorHandler->handleError('8', 'Indirect modification of overloaded property Cookie::$_context has no effect', '/home/cyeshop/classes/Cookie.php', '142', array('expire' => '0')) in Cookie.php line 142
- at CookieCore->setExpire('0') in IndexController.php line 44
- at IndexControllerCore->initContent() in Controller.php line 205
- at ControllerCore->run() in Dispatcher.php line 428
- at DispatcherCore->dispatch() in index.php line 28
$cookie->__set(íd', 'AAA');
However, I want set this cookie value expiry time to browser close, not want to change the cookie global time in admin -> preference -> default is 240 hours
I tried $cookie->setExpire(0); but it will show below error, seem setExpire cannot overload the global cookie. So what command can only set this value to expired when browser closed?
- in Cookie.php line 142
- at ErrorHandler->handleError('8', 'Indirect modification of overloaded property Cookie::$_context has no effect', '/home/cyeshop/classes/Cookie.php', '142', array('expire' => '0')) in Cookie.php line 142
- at CookieCore->setExpire('0') in IndexController.php line 44
- at IndexControllerCore->initContent() in Controller.php line 205
- at ControllerCore->run() in Dispatcher.php line 428
- at DispatcherCore->dispatch() in index.php line 28