Welcome Guest, Not a member yet? Register   Sign In
Session data lost after redirect randomly (CI4.1.5)
#4

You could try this merging the arrays:

PHP Code:
$cartData $session->get();
$newData  = ['cart' => $cart'orderId' => $order['id']];

$sessionData array_merge($cartData$newData);

$this->session->set($sessionData);
log_message('error''Debug: add to cart, session set: '.json_encode($_SESSION));
return 
redirect()->to('/cart'); 


See if that works, I do not have the time to test it right now.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
RE: Session data lost after redirect randomly (CI4.1.5) - by InsiteFX - 08-25-2022, 12:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB