S
S
shearlocktm2015-09-15 16:59:55
PHP
shearlocktm, 2015-09-15 16:59:55

How to properly organize the storage of the id list in COOKIE?

Good afternoon!
Please tell me how to properly organize cookies in one variable, storing a list of apartment id for favorites?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Ineshin, 2015-09-15
@shearlocktm

Serialize to JSON. JSON.stringify(object);- will turn your data structure into a string that can be stored in cookies. And then, having loaded back a line, through JSON.parse(string);you will receive back the data.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question