MozillaZine

How can get Firefox 57 to delete all session cookes?

User Help for Mozilla Firefox
azbruno
 
Posts: 11
Joined: June 9th, 2009, 5:33 pm

Post Posted December 16th, 2017, 10:34 am

I run Firefox 57 with "Accept cookies from websites" unchecked. I then create exceptions for any site in which I want the cookie. For a very few of those sites I want the cookies to be maintained permanently (or until I explicitly remove them) so I add them to the exceptions with "Allow". Most of them are added as "Allow for Session". I want those cookies to disappear when I close the session. But that does not seem to be happening. I can reopen Firefox and a lot of those session cookies are still there.

If I check "Clear history when Firefox closes" and check Cookies, I understand that would delete all the cookies, even those few I want to keep.

I was able to run this way with addons prior to FF 57, but now I can't find a way to get those session cookies to go away, leaving only the ones I want.

I've tried using the Cookie Sweep addon which does get rid of a lot of the cookies, but it too does not get rid of all the session cookies.

Reflective

User avatar
 
Posts: 2283
Joined: February 15th, 2007, 11:13 am

Post Posted December 16th, 2017, 11:25 am


azbruno
 
Posts: 11
Joined: June 9th, 2009, 5:33 pm

Post Posted December 16th, 2017, 11:43 am


I looked into this one. My concern is that it is basically a complete replacement of whitelist/graylist. I want to continue to use Firefox's exception list so I have the ability to move to a better addon should a proper API be developed.

My real question is... why does Firefox indicate you can allow the cookies for the session, but then keep them beyond? Is it a bug in Firefox that would hopefully be fixed sometime, or is there some operation necessity that I can't understand?

allande
 
Posts: 188
Joined: July 20th, 2017, 11:58 am

Post Posted December 16th, 2017, 11:55 am

I suspect session cookies are kept for sites that are linked to by sites that restore when you restart, or home page, or sites shown in your new tab page.
Another idea for a non-cookie extension that may help- using noscript will stop many sites from contacting their tracking servers, preventing those cookies from being stored.
Or, you can enable the "tracking protection" feature that is included in private browsing mode even in normal mode: https://support.mozilla.org/en-US/kb/tr ... protection
These may not prevent or delete all or any cookies, I am only suggesting them as experiments to try.

azbruno
 
Posts: 11
Joined: June 9th, 2009, 5:33 pm

Post Posted December 16th, 2017, 12:59 pm

allande wrote:I suspect session cookies are kept for sites that are linked to by sites that restore when you restart, or home page, or sites shown in your new tab page.
Another idea for a non-cookie extension that may help- using noscript will stop many sites from contacting their tracking servers, preventing those cookies from being stored.
Or, you can enable the "tracking protection" feature that is included in private browsing mode even in normal mode: https://support.mozilla.org/en-US/kb/tr ... protection
These may not prevent or delete all or any cookies, I am only suggesting them as experiments to try.


My home page and new tab page are about:blank, so no cookies needed there. And I do use NoScript to keep lots of crap out of the browser.

One thing I find interesting is that when I close all my tabs and run Cookie Sweep, it will tell me it removed a large number of cookies. Then I can run it again and it will indicate something like removing 20 cookies, but those are the ones that really are not being removed. Each time I run Cookie Sweep with no tabs it will report removing the same number of cookies.

Gingerbread Man

User avatar
 
Posts: 7741
Joined: January 30th, 2007, 10:55 am

Post Posted December 16th, 2017, 1:18 pm

azbruno wrote:Most of them are added as "Allow for Session". I want those cookies to disappear when I close the session. But that does not seem to be happening.

That's how I've also handled cookies for years and it still works to this day. I also don't like any of the cookie management add-ons available now.

Try this in a brand new profile:
  1. [_] Accept cookies from websites
  2. Accept third-party cookies: Never (disabled)
  3. Keep until: I close Firefox (disabled)
  4. When Firefox starts: Show your windows and tabs from last time
  5. browser.sessionstore.restore_on_demand = true (default)
  6. https://bing.com "Allow for Session" exception
  7. https://www.bing.com loaded in a background tab. Current tab is about:preferences.
  8. Exit, then relaunch Firefox. bing.com cookies are gone. It's important to quit and restart manually, since the button on about:profiles, the restart developer toolbar command, add-on and update restarts will intentionally preserve session cookies.

azbruno
 
Posts: 11
Joined: June 9th, 2009, 5:33 pm

Post Posted December 16th, 2017, 2:02 pm

OK, now I've figured it out.

In the Privacy and Security settings, I have the Accept cookies from websites unchecked, which means that the "Keep until" option is grayed out. The problem was that I had that set to "Keep until they expire" instead of "Keep until I close Firefox". When I select "Show Cookies..." and see the cookies that are not being removed, the details show "Expires: At end of session". Silly me... I took that to mean the cookies expired at the end of session and therefore "Keep until they expire" should mean "Keep until end of session". But nooooo. And since it was grayed out, I did not think that it would affect things, but changing it solved the problem for me.

I do hate it when UI options that need to be changed are grayed out. ("You can't get there from here.")

Thanks for all your assistances.

Gingerbread Man

User avatar
 
Posts: 7741
Joined: January 30th, 2007, 10:55 am

Post Posted December 17th, 2017, 2:31 am

azbruno wrote:Silly me... I took that to mean the cookies expired at the end of session

Looks like it happens when you've selected "When Firefox starts: show your windows and tabs from last time". Filed bug 1425727; feel free to follow that to see if it goes anywhere, but please don't post "me too" comments.

azbruno
 
Posts: 11
Joined: June 9th, 2009, 5:33 pm

Post Posted December 17th, 2017, 12:26 pm

Gingerbread Man wrote:Looks like it happens when you've selected "When Firefox starts: show your windows and tabs from last time". Filed bug 1425727; feel free to follow that to see if it goes anywhere, but please don't post "me too" comments.


No, I never did that. I didn't try the suggestion you'd made. I just saw your step 3 and looked into that setting. I had to check to allow cookies, then change the Keep until setting and then uncheck the allow setting again.

The terminology used by FF made it confusing.

dickvl

User avatar
 
Posts: 52415
Joined: July 18th, 2005, 3:25 am

Post Posted December 17th, 2017, 7:05 pm

Bug 1425727 - Unchecking "Accept cookies from websites" should switch to "Keep until: I close Firefox

I wouldn't want other cookie settings to change when I temporarily would disable all cookies or otherwise change network.cookie.cookieBehavior manually.
The setting in the user interface is just one place where it can be confusing, but changing cookie settings otherwise shouldn't affect other cookie settings.
Selecting "Remember History" already does this and restore some default settings.

I hope this bug will be marked as won't fix.

You can set network.cookie.thirdparty.sessionOnly to true on the about:config page to make third-party cookies behave as session cookies that expire when Firefox is closed.

Gingerbread Man

User avatar
 
Posts: 7741
Joined: January 30th, 2007, 10:55 am

Post Posted December 17th, 2017, 11:06 pm

dickvl wrote:I hope this bug will be marked as won't fix.

Merry Christmas. It's been duped to bug 530594, which is basically the same as tossing it in the trash.

kreemoweet
 
Posts: 729
Joined: December 30th, 2009, 11:25 pm

Post Posted December 18th, 2017, 3:05 pm

The bug here (assuming OP's description is valid) is that FF is ignoring the "Allow for Session" setting when a site is so entered on the Cookie Exception list. Any of the other settings under "Accept Cookies From Sites"
should be irrelevant, and most especially so if they are grayed out. Perhaps the OP could list some concrete Steps to Reproduce with a specific site and cookie?

Gingerbread Man

User avatar
 
Posts: 7741
Joined: January 30th, 2007, 10:55 am

Post Posted December 18th, 2017, 4:46 pm

kreemoweet wrote:Any of the other settings under "Accept Cookies From Sites" should be irrelevant

They should be, but aren't. Given that unchecking Accept cookies already switches Accept third-party cookies: Never, it makes sense to me to also switch Keep until: I close Firefox, hence my bug report. At first glance at least, it seems like a quick solution, though I'm willing to be convinced otherwise if there are underlying mechanisms I'm not aware of.

Bug 530594 is a black hole for session cookies persisting past a restart. It probably also covers the root cause of this, along with the kitchen sink. It's been open for close to a decade and hasn't been worked on for nearly 1 year. If something ends up there, you can forget about it being resolved in the foreseeable future.

azbruno
 
Posts: 11
Joined: June 9th, 2009, 5:33 pm

Post Posted December 18th, 2017, 7:39 pm

kreemoweet wrote:Perhaps the OP could list some concrete Steps to Reproduce with a specific site and cookie?


I'll try...
1. In about:preferences#privacy...
Accept cookies from websites - unchecked
Accept third-party cookies - Never
Keep until - they expire
2. Set exception for https://amazon.com as Allow for Session.
3. Open tab at amazon.com
4. Show Cookies... from preferences. Amazon cookies are there. Look at each cookie and it says Expires: At end of session.
5. Close amazon.com tab. Look at cookies again. No change.
6. Close Firefox and reopen.
7. Check cookies again to see that Amazon cookies are still there.

If Keep until I close Firefox is set, then at step 7 the cookies are gone, which is what should happen.

My point is that Firefox is telling me that the cookies expire at the end of session. And I have configured to keep cookies until end of session. Then come end of session they should be deleted, but they are not.

dickvl

User avatar
 
Posts: 52415
Joined: July 18th, 2005, 3:25 am

Post Posted December 18th, 2017, 9:53 pm

Best is to remove all existing cookies when you make change to the cookie lifespan because the changed setting are probably only applied to newly created cookies and not to existing cookies.

Return to Firefox Support


Who is online

Users browsing this forum: No registered users and 16 guests