-->

Firefox duplicate cookie (Firefox bug?)

2020-08-11 13:07发布

问题:

It's my understanding that if you send a cookie with the sane Name, Host, and Path, that it will be interpreted by the browser as a replacement.

This seems to be the case in Chrome, but in Firefox (7.01) I'm instead getting multiple cookies that are completely identical except for the content.

All 3 SqlAuthCookie entries are identical except for the "Content" part.

Is this a bug in Firefox or do I have a fundamental misunderstanding of how cookies work?

回答1:

This only occurs if you keep the Cookie window open while the cookies are being set. Once you close and re-open the Cookie window, you should only see the latest value stored.

Similarly, if you delete a cookie while the Cookie window is open, it will still show up in the list until you close and reopen the Cookie window.

I'm speaking from experience - I've been frustrated by the same thing - unfortunately I don't have any proof, nor do I know if this is a bug or an intentional feature.

Update

Interestingly enough, Google Chrome behaves similarly. If you open the Options tab, the cookie values that are displayed under "All cookies and site data" do not change until you close and re-open the tab. I'm guessing this is an intentional feature for both browsers.