CodeIgniter Forums
add to cart (session variables) not working - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: add to cart (session variables) not working (/showthread.php?tid=44561)



add to cart (session variables) not working - El Forum - 08-18-2011

[eluser]Davcon[/eluser]
Hi,

I wonder if anyone can help.

I have built a shopping cart using Codeigniter. I did not use the onboard shopping class cart - I wrote my own script.

Everything works fine except for one thing - for a very small number of people when they add an item to cart it says that the cart is empty. So, the items simply do not add.

Does anyone know what might be causing this? I'm stumped.


The way the cart works is using native PHP sessions. So, when somebody adds to the cart, it records their session id and inserts that, along with their item details onto a MySQL table.


add to cart (session variables) not working - El Forum - 08-18-2011

[eluser]smilie[/eluser]
The only thing I can think of (and what happened to me too) is that your session data is too large.
I have switched to MySQL session storage and problem solved. So - if those couple of customers are having lot's of items (data) in session - that could be the problem Smile

In my case - I could not add more then nine products to (self written) shopping cart.


add to cart (session variables) not working - El Forum - 08-18-2011

[eluser]Davcon[/eluser]
Hi,

Thanks. I really appreciate your response. However, these folks are having problems upon adding just one item.

I have a feeling that it might be to do with them having some dodgy settings on their browsers (perhaps not accepting session cookies or something). However, I don't expect the client will be happy if I tell him "It's their fault".


add to cart (session variables) not working - El Forum - 08-18-2011

[eluser]smilie[/eluser]
well try to establish on which browsers / OS's it occurs. I can not think of reason why would it fail?! :S