Welcome Guest, Not a member yet? Register   Sign In
Session update in shoppingcart
#1

[eluser]Unknown[/eluser]
I've resolved my problem using the db_session library. Sorry for being lazy Smile

Original post:
Hi,
I've run into a problem that i cannot find the best solution to. I'm building a shopping cart website based on CI. The items I add don't seem to show up in the cart/view page. I noticed that the CI session handler refreshes the session cookie once in 5 minutes, but i need the newly added item to be shown immediately. In the documentation there is a note that refreshing more often consumes processor power, so i would appreciate some advice on it.
I'm implementing the cart in the following way:
I first use $cart = $this->session->get_userdata('cart') to get the cart array, then append new items to it and then use $this->session->set_userdata('cart',$cart) to set the new cart array. The first two items show immediately, but after that, nothing.

Thanks in advance.




Theme © iAndrew 2016 - Forum software by © MyBB