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

前端 未结 4 403
慢半拍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:27

    Well, mostly we do sessions -- send a single cookie with an identifier for the user, and store all the option values on the server. But if I really didn't want to do a session for some reason, I suppose I'd probably do the single cookie on account of it creating less network traffic if done properly.

提交回复
热议问题