Search code examples
cookies

in a website, setting one cookie is better than setting many single cookies?


Suppose that you have to set 12 cookies, would it be better to store all of their values in a single "big" cookie or store each value on its own cookie? I want to know if that improves website speed.

Thanks.


Solution

  • I think the maximium size of a cookie is about 4k. If you need to store more data than that, then you're better off using several cookies.

    i don't think there will be a big performance issue using multiple cookies. in my opinion, it may be more efficient to store each piece of data in its own cookie rather than parsing through a bogger cookie for each "crum" of data each time you need it.

    Hope this helps!