max number of cookies Per-Domain doesnot work

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
Posts: 4
Joined: February 27th, 2017, 7:50 pm

Post Posted February 27th, 2017, 10:51 pm

Hi, all
We are soft engineers from Alibaba-inc . Recently, We encounter a problem of repeatedly signing in to a page which reqires logined session, it make us confused. Finally, we found the cause of that problem : the cookies which denoted logined session were evicted! Then we check all the cookies that stored by firefox, and found two phenomenons:
(1) the number of cookies belong to the domain( is not exceeding 150.
(2) the number of cookies whose root domain is reached 150 (including sub domain cookies).
So can we guess that firefox has some bugs in storing cookies for each domain ?

In order to verify our guess, we also make a test, and list the procedures(firefox version 50.0):

1. We clear all the cookies that stored by firefox, then visit page =

2. Using js script to write 150 cookies( in the console of firefox. The js script as follows:
Code: Select all
function setCookie(name,value) {
    var Days = 30;
    var exp = new Date();
    exp.setTime(exp.getTime() + Days*24*60*60*1000);
    document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString()+";"

for(var i=1;i < 151;i++){

3. check the cookies stored in firefox, found it is ok with 150 cookies in domain of


4. visit page = , then check cookies , found that some cookies(belong to were evicted,but those cookies have different domain with the later ones, as following pictures indicate:


So , from the above test case, we can see that the total number of cookies in the root domain of is also 150, but each sub domain does't reach its limit number of 150. Then we conclude that firefox may have bugs in its implementation of storing cookie , so we just put forward such problem for discussing, anyone else who encounter such case can contact us. We hope firefox developers can reply to us whether this is a true bug or not, thanks a lot :D .

Posts: 387
Joined: September 6th, 2006, 1:39 pm

Post Posted March 5th, 2017, 8:23 am

The Firefox developers won't read your post here, you should check for existing issues and then report a new one.

But, you should think about that huge number of cookies. Given that all that data is send back to the server on each and every request, that's a lot of data going back to your servers and you could get better performance for your users by reducing that.

Return to Web Development / Standards Evangelism

Who is online

Users browsing this forum: No registered users and 2 guests