Question

I want to store a database table in a cookie (for example, to store items in a shopping cart for a user that is not logged in).

My problem is, say the table has a list of items where I need to store an ID and amount for each item.

What is a good data structure I could use for PHP to store the data in the cookie?

Was it helpful?

Solution

Cookie Can only store 4KB of session data.You can store the session data in the database or cache in the raw file at server. if you really wish to store the data at client side take a look on some of these javascript storage libraries pablotron , DojoStorage , localstrogage Firefox,Chrome,Safari,Internet Explorer 8+ 5 MB per domain.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top