Closed Bug 1321319 Opened 9 years ago Closed 9 years ago

nsICookieManager enumerator don't work properly

Categories

(Core :: Networking: Cookies, defect)

50 Branch
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: nikosdamis, Unassigned, NeedInfo)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0 Build ID: 20161114144739 Steps to reproduce: Hello I am developing an add-on and I want to track the cookies I get when I visit a website. To do that I use the enumerator property of the nsICookieManager. My problem is that I should get all the cookies from the specific site I visit everytime, but instead I take some cookies from the previous visited site. I will attach my add-on files and you can reproduce my problem by running the add-on with jpm. For instance visit youtube.com first and then intel.com. Actual results: This is what I get to my console: user@snf-727776:~/Desktop/my-addon$ jpm run JPM [info] Starting jpm run on My Jetpack Addon JPM [info] Creating a new profile console.log: tupwma: https://www.youtube.com/ console.log: tupwma: 0 console.log: tupwma: 6 console.log: tupwma: Array [".youtube.com",".youtube.com",".youtube.com",".youtube.com",".doubleclick.net",".doubleclick.net"] console.log: tupwma: Array ["VISITOR_INFO1_LIVE","YSC","PREF","CONSENT","id","IDE"] console.log: tupwma: http://www.intel.com/content/www/us/en/homepage.html console.log: tupwma: 0 console.log: tupwma: 26 console.log: tupwma: Array [".bluekai.com",".bluekai.com",".intel.com",".intel.com",".intel.com","www.intel.com",".intel.com",".intel.com",".intel.com",".intel.com",".intel.com","www.intel.com",".intel.com",".intel.com",".intel.com",".intel.com",".intel.com",".youtube.com",".youtube.com",".youtube.com",".intel.tt.omtrdc.net",".intel.tt.omtrdc.net",".adform.net",".doubleclick.net",".doubleclick.net","onsite2.researchintel.com"] console.log: tupwma: Array ["bkdc","bku","detected_bandwidth","src_countrycode","countrylang","ref","wa_visitId","gawap","_gat_waptracker0","_gat_waptracker1","intelresearchREF","OldBrowsersCookie","mbox","intelresearchUID","intelresearchSID","intelresearchSTG","utag_main","YSC","VISITOR_INFO1_LIVE","PREF","mboxSession","mboxPC","uid","id","IDE","ASPSESSIONIDQAQSDQCC"] Expected results: This is the expected result: ser@snf-727776:~/Desktop/my-addon$ jpm run JPM [info] Starting jpm run on My Jetpack Addon JPM [info] Creating a new profile console.log: tupwma: https://www.youtube.com/ console.log: tupwma: 0 console.log: tupwma: 6 console.log: tupwma: Array [".youtube.com",".youtube.com",".youtube.com",".youtube.com",".doubleclick.net",".doubleclick.net"] console.log: tupwma: Array ["VISITOR_INFO1_LIVE","YSC","PREF","CONSENT","id","IDE"] console.log: tupwma: http://www.intel.com/content/www/us/en/homepage.html console.log: tupwma: 0 console.log: tupwma: 25 console.log: tupwma: Array [".eloqua.com",".eloqua.com",".eloqua.com",".bluekai.com",".bluekai.com",".intel.com",".intel.com",".intel.com",".intel.com","www.intel.com",".intel.com",".intel.com",".intel.com",".intel.com",".intel.com","www.intel.com",".intel.com",".intel.com",".intel.com",".intel.com",".intel.tt.omtrdc.net",".intel.tt.omtrdc.net",".adform.net","onsite2.researchintel.com",".google.com"] console.log: tupwma: Array ["ELOQUA","ELQSTATUS","BKUT","bkdc","bku","_gat_waptracker0","detected_bandwidth","src_countrycode","countrylang","ref","wa_visitId","gawap","_gat_waptracker1","intelresearchREF","mbox","OldBrowsersCookie","intelresearchUID","intelresearchSID","intelresearchSTG","utag_main","mboxSession","mboxPC","uid","ASPSESSIONIDQAQSDQCC","NID"]
Component: XPCOM → Networking: Cookies
This works for me as expected with Firefox 50.0.2 on Windows 8.1. doubleclick.net is only the list generated after visiting youtube.com Possible reason: youtube.com is still open after the list got generated and the cookies removed, and a script sets them again. I see you already checked for that. Do you see any network requests finished after the removeAll has been called the first time (for youtube.com) after you enabled logging net requests in the console?
Flags: needinfo?(nikosdamis)
Even more likely of an issue - nsICookieManager.removeAll runs asynchronously. Which would explain why adding a second call (which takes up more time) would be more likely get you to an empty state. I'm going to mark this invalid, reporter please re-open if you can come up with a test case that ensures all cookies are cleared before trying to log again and you still have this issue.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: