Jump to content

Edit History

Joey

Joey

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?

  1. in Cookie.php line 142
  2. 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
  3. at CookieCore->setExpire('0') in IndexController.php line 44
  4. at IndexControllerCore->initContent() in Controller.php line 205
  5. at ControllerCore->run() in Dispatcher.php line 428
  6. 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?

  1. in Cookie.php line 142
  2. 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
  3. at CookieCore->setExpire('0') in IndexController.php line 44
  4. at IndexControllerCore->initContent() in Controller.php line 205
  5. at ControllerCore->run() in Dispatcher.php line 428
  6. at DispatcherCore->dispatch() in index.php line 28

 

Joey

Joey

Hi! I can store the cookie using following command successfully

$cookie=&$this->context->cookie;
$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?

  1. in Cookie.php line 142
  2. 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
  3. at CookieCore->setExpire('0') in IndexController.php line 44
  4. at IndexControllerCore->initContent() in Controller.php line 205
  5. at ControllerCore->run() in Dispatcher.php line 428
  6. 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?

  1. in Cookie.php line 142
  2. 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
  3. at CookieCore->setExpire('0') in IndexController.php line 44
  4. at IndexControllerCore->initContent() in Controller.php line 205
  5. at ControllerCore->run() in Dispatcher.php line 428
  6. at DispatcherCore->dispatch() in index.php line 28

 

Joey

Joey

Hi! I can store the cookie using following command successfully

$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?

  1. in Cookie.php line 142
  2. 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
  3. at CookieCore->setExpire('0') in IndexController.php line 44
  4. at IndexControllerCore->initContent() in Controller.php line 205
  5. at ControllerCore->run() in Dispatcher.php line 428
  6. at DispatcherCore->dispatch() in index.php line 28

 

×
×
  • Create New...