Page 1 of 1

How long do Cart Cookies Live?

Posted: Tue Nov 11, 2008 8:51 am
by jty
I have noticed that Open Cart keeps the cart contents even after shutting down my PC. The cart contents aren't cleared unless the buyer checks out
My question is, when do the cookie cart contents expire (apart from checking out) ?

Re: How long do Cart Cookies Live?

Posted: Tue Nov 11, 2008 8:54 am
by Qphoria
Depends on your browser.
IE7 instantly on shut down
Firefox i think holds it for 2hours

Re: How long do Cart Cookies Live?

Posted: Tue Nov 11, 2008 9:16 am
by jty
Nah, I just tested on IE7
Added items to cart > shutdown
Came back in, logged in and the items are still in my cart.
Nevermind. I'll think of another way to sort out my latest can of worms.

I'll checkout your one step checkout today and post feedback there
Thanks again

Re: How long do Cart Cookies Live?

Posted: Wed Nov 26, 2008 10:03 pm
by mikeytrw
Im having cart clearing issues myself, even after loggin out. in fact, even after an order has been processed and cart->clear() has been called  ???

Re: How long do Cart Cookies Live?

Posted: Wed Nov 26, 2008 10:41 pm
by Qphoria
Cookies last 1 hour

To clear the cart properly, there are actually a few things to update:

Code: Select all

// Clears the cart itself
$cart->clear;
// Clear the cart session variable
$this->session->delete('cart');
// Clear the customer's db cart
$this->database->query("update customer set cart = '' where customer_id = '" . (int)$this->data['customer_id'];