One cookie with many values or many cookies with one value?

前端 未结 4 408
慢半拍i
慢半拍i 2021-02-07 06:43

If I have many settings that I want to store in a cookie, should I create multiple cookies with one option each, or one big cookie with multiple options in a serialized array or

4条回答
  •  旧巷少年郎
    2021-02-07 07:23

    A good reason to have separate cookies is so each one is independent of the others, that is to say, an individual cookie can then be expired without affecting other ones, which is not possible if you have everything stored in one big cookie.

提交回复
热议问题