문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top