Lusito / forget-me-not

Make the browser forget website data, except for the data you want to keep.
zlib License
227 stars 25 forks source link

Simply want to delete HSID cookie on google.com #145

Closed snowbound closed 5 years ago

snowbound commented 5 years ago

I tried this extension and removed it. I simply want to either delete on Firefox closure the HSID cookie assigned to Google.com by me logging to Gmail. I DO NOT want to delete all 12 cookies for the Google.com. I gave up in frustration yet again.

Lusito commented 5 years ago

Hi @snowbound. You can do that by creating a cookie specific rule. for example HSID@*.google.com But I'm not sure you can actually log in without that cookie. Hope this helps.

snowbound commented 5 years ago

When I exit the Firefox by clicking on the X on the browser I want to be automatically logged out of all my Gmal accounts without having to remember to use the Gmail. Logout option. I have been using a cookie editor to go into the Gmail tab and set the HSID cookie to Session type If I do that then when Firefox starts up I am not logged in. However, this process is something I would want to automate.

I can delete all the cookies for google.com via Firefox option but that deletes all of the subcookies for google.com including my 2 Factor Authentication cookie which I do want to keep.

I tried creating a rule hsid@*.google.com for on Leave. That should delete that particular cookie should it not? It does not or at least I am remaining logged into Gmail.

Lusito commented 5 years ago

These steps should be needed for your scenario:

  1. Set *.google.com to "Never" (I assume your fallback rule is "On Leave").
  2. Set hsid@*.google.com to "On Startup" to remove the hsid cookie on startup, so that the cookie gets removed on browser restart.
  3. Enable the checkboxes to remove cookies on startup in settings -> cleanup and make sure "Apply rules" is checked as well. I.e. The shield is not crossed with a red line.
  4. Now, when you restart your browser, all domains that are still open will be protected. So if you restore your session and google.com is still open in a tab, your cookies will not be removed. Neither will they if you have google.com configured to be the homepage you see when you open a new tab.

I'm assuming you missed step 3 or step 4 is the problem for you. If it's the latter, the current version of FMN can't do what you're asking for. I could add a checkbox to remove cookies from open domains as well, if that is what you want (it might break websites that get re-opened).

If this explanation didn't show you what might be the cause of your issue, I would need more information from you, like what your settings are (either export them from the settings tab or create a screenshot) and what your scenario looks like when you restart (do you restore your tabs, do you have google.com instantly open, etc.)

snowbound commented 5 years ago

Really appreciate all the help you have given me on this issue. I followed your instructions and they do work i.e. it does indeed delete the HSID cookie. However, I did not realize that deleting this cookie also removes the configuration options I had set up for the visual configuration for my YouTube i.e. Dark theme enable and No Autoplay settings are back to default. I also tried instead deleting the HSID cookie but that too resulted in the same unwanted results. That is not an issue caused by your extension but apparently how Google operates wrt to cookie deletion.

It is just strange that in Chrome I can tell it to delete cookies for Google.com and the result is what I want. I am logged out of all my Google accounts with none of the undesirable effects on Youtube settings.

Oh well, it was worth a shot on my part. Thanks again for the timely responses to my issues. That is uncommon these days.

Lusito commented 5 years ago

I'm at work, so I can't currently try this in FMN, but I've just compared logged in vs google just remembering my account:

These cookies get removed: SID,HSID,SSID,APISID,SAPISID,SIDCC

And this one gets modified: NID

Maybe try removing those and see if it gets you your expected results?

snowbound commented 5 years ago

Thanks for replying from work however it seems that I may have taken the wrong approach to do the logout process. It seems deletion of cookies causes undesirable effects for me. Youtube configuration settings are lost i.e. dark theme is no longer enabled and Autoplay of next video is also enabled. Both of these settings have been reset to default. It appears that the only way of not affecting these items along with leaving 2 Factor Authentication cookies set is to actually flip the Session flag for example in the HSID cookie to on from its default state of off. That allows one to be logged out without affecting other settings. This simulates the process performed by clicking on https://accounts.google.com/Logout?hl=en

snowbound commented 5 years ago

I again looked at your extension and the cookie browser is still not showing the HSID cookie for .google.com that I am currently manipulating manually via Cookie Editor extension on one of my Gmail account tabs. I went to the cookie browser typed in .google.com and proceeded to expand EVERY cookie that your extension showed and none of them had HSID identifier nor did any of them have the value showing up in Cookie Editor and Cookie Manager extension when on a Gmail tab. Is your cookie browser somehow overlooking/missing this cookie or are these 2 other extensions miss reporting the existence of this cookie? This is the cookie whose Session attribute I toggle on which causes Firefox to log me out on browser closure.

Lusito commented 5 years ago

The filter field also searches the key and the value of cookies, so you can type in HSID to look for it. I just tried it myself and you are right, for some reason my cookie browser does not list them. I will investigate.

Lusito commented 5 years ago

Found and fixed the issue. Will be solved in the next version

Lusito commented 5 years ago

The new version has just been released, you should now be able to see the hsid cookies. As said, searching for hsid will give you quick results.

snowbound commented 5 years ago

Thanks very much for the very quick fix to the extension. It now shows the HSID cookie. However, deleting that cookie removes configuration settings for YouTube such as enabling dark theme and disabling autoplay. Seems I have to resign myself that if I want to continue to use Firefox and want Gmail logout on close automatically I will have to manually flip the Session flag on each time I login so that the cookie remains in the browser and retains these settings.

Lusito commented 5 years ago

So, I just tried the following:

Did I do anything different than you?

snowbound commented 5 years ago

Yes you "Added .youtube.com and .google.com as "Never""

[Startup Cleanup](https://imgur.com/d83GMcP

Lusito commented 5 years ago

Well, if you haven't set them to Never, the other cookies will get removed, and as such, your settings forgotten. Do you want to forget those cookies (+storage) or not? Either you keep them and remember your settings or you clean them and forget your youtube settings.

snowbound commented 5 years ago

Ya, I unchecked everything other than the Cookies option on the Startup column and it appears to be working. Youtube is still showing the account but that is minor. Seems to be working fine. Thanks again for the quick replies. Appreciate it.

Lusito commented 5 years ago

No worries, glad It's working for you now :)