javascript - What happens if I exceed the limit of maximum cookies - Stack Overflow

As far as I read there is are two limits on the number of cookies : 20 cookies per unique host or domai

As far as I read there is are two limits on the number of cookies :

  • 20 cookies per unique host or domain name
  • a total of 300 cookies

What does happen if I exceed one of these limits ?

As far as I read there is are two limits on the number of cookies :

  • 20 cookies per unique host or domain name
  • a total of 300 cookies

What does happen if I exceed one of these limits ?

Share Improve this question asked Mar 10, 2017 at 9:25 NixNix 4516 silver badges13 bronze badges 1
  • 7 You should eat some of them, don't hoard too many cookies at once. – Arg0n Commented Mar 10, 2017 at 9:30
Add a ment  | 

2 Answers 2

Reset to default 7

Short Answer:

  1. If you exceed the limits per host/domain, the cookies simply won't be saved.

  2. If you exceed the total number of cookies, Your browser will alert you that the maximum number of cookies has been reached

Note that your question states that the max number of cookies per host is 20 and the total allowed is 300. However, this is not pletely true. The number of maximum cookies is highly dependent on the Browser. For example,

  • Chrome 9 allowed 180 cookies per domain
  • Firefox 3.6.3 allowed 50 cookies per domain

As far as the RFC spec goes, the minimum requirements are:

  • at least 300 cookies
  • at least 4096 bytes per cookie
  • at least 20 cookies per unique host or domain name

This resource can help you test browser cookie limits. Also this SO post will shed some light on the design and performance aspect.

References: Cookie Limit per domain, Browser Cookie Restrictions

I tried adding lots of cookies with a quick loop (100 at a time) both Chrome 69.0.3497 and FireFox 62.0.3 remove the older cookies and store the new ones.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743651240a4484613.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信