this post was submitted on 01 Nov 2023
32 points (100.0% liked)

Firefox

20372 readers
182 users here now

/c/firefox

A place to discuss the news and latest developments on the open-source browser Firefox.


Rules

1. Adhere to the instance rules

2. Be kind to one another

3. Communicate in a civil manner


Reporting

If you would like to bring an issue to the moderators attention, please use the "Create Report" feature on the offending comment or post and it will be reviewed as time allows.


founded 5 years ago
MODERATORS
 

Hi, So, I wipe all cookies on every restart of firefox by default.

However, there are a very very few cookies I would like to restore. And only to certain multi-account containers

They are the session cookie to the few websites I login to. Because I'm annoyed to have to login again on every reboot.

But I still want to wipe every other cookies they store.

I tried to make a bookmarklet that can save the session cookie

Example this

javascript:(function() {     function getCookie(name) {         var value = "; " + document.cookie;         var parts = value.split("; " + name + "=");         if (parts.length == 2) return parts.pop().split(";").shift();     }     var cookieValue = getCookie('session_id');     if (cookieValue) {         var data = new Blob([`session_id=${cookieValue}`], {type: 'text/plain'});         var a = document.createElement('a');         a.style.display = 'none';         document.body.appendChild(a);         var url = window.URL.createObjectURL(data);         a.href = url;         a.download = 'session_id.txt';         a.click();         window.URL.revokeObjectURL(url);     } else {         alert('Cookie "session_id" does not exist.');     } })();

Unfortunately, unlike regular cookies, this doesn't work and it returns the cookie doesn't exist.

I would have made another bookmarklet which create a cookie from the file.

What I really need is an addon that lets me specify which cookies to save and restory, in which multi-account container

all 7 comments
sorted by: hot top controversial new old
[–] jbhq@lemmy.ml 2 points 2 years ago* (last edited 2 years ago) (1 children)

Create a cookie exception (to prevent deletion)
When accessing a site you’d (from address bar/^i) open permissions and specifically ALLOW cookies for that site.

[–] interdimensionalmeme@lemmy.ml 1 points 2 years ago

But I don't want to allow all cookies from that site to remain after restart, only the session cookies and only in the multi account container I specify

[–] essellburns@beehaw.org 0 points 2 years ago (1 children)

My solution..

Use waterfox with cookies turned on for a small number of websites.

Use Firefox with automatically wipe for everything else.

[–] interdimensionalmeme@lemmy.ml 1 points 2 years ago (1 children)

But those exception, get to have all their cookies. I want to limit them to only the cookies I allow (session token and nag-didablers)

[–] essellburns@beehaw.org 1 points 2 years ago

Another approach would be to have Firefox remember the passwords for a small number of sites, while deleting cookies after each session