What is the maximum size of a cookie, and how many can be stored in a browser for each web site?

后端 未结 9 1229
猫巷女王i
猫巷女王i 2020-11-27 16:36

I am learning about cookies, and I wonder about browser support when writing web applications that rely on cookies to store state.

  • For each domain/web site,

9条回答
  •  南方客
    南方客 (楼主)
    2020-11-27 17:00

    If you are concerned about performance decreases due to large cookies being sent on each server request, a good idea might be to place all your static files (images, CSS, etc.) into a subdomain of your site, like http://static.yourdomain.com.

    In this way, whenever your site on www.yourdomain.com asks for a static file,like an image, the browser won't send the cookie along with the HTTP request anymore.

    Source: http://developer.yahoo.com/performance/rules.html#cookie_free

提交回复
热议问题