thewh1teagle / rookie

Load cookies from your web browsers
https://crates.io/crates/rookie
MIT License
204 stars 18 forks source link

[Feature Request]: Dealing with cookies with "Session" expiry #10

Closed InstanceGaming closed 1 year ago

InstanceGaming commented 1 year ago

Describe the feature

At this time, I have observed in Chrome, 118.0.5993.71 at the very least, that cookies set as Expiry=Session do what they say on the tin: they are not stored within the database file at anytime.

I am fairly certain this is a unsolvable problem within the confines of the "reading the Cookies database file" solution that this project and those like it rely on to provide functionality, however, I think it would be worth opening at issue on this, if for no other reason than to direct future users to this, as this will certainly become a regularly-asked question. I have yet to see mention of this fundamental gap in functionality mentioned for this project in the documentation, much to the dismay of those who embark on using this code to solve their problem, only to find their one problem cannot be solved by these means.

For said future developers with this problem: my one recommendation to you is to write a browser extension to read the cookie when it is sent by the server, if there is no other option (like submitting a login form instead, which I suppose you've already considered by now).

If you don't think this issue will have any benefit to you/this project, feel free to close it, no hard feelings. :)

thewh1teagle commented 1 year ago

The issue already mentioned, and I described deeply why it happens in https://github.com/thewh1teagle/rookie/issues/8 But if you faced it too, it's worth keep this issue open until we solve it. As you can see in the description I wrote in https://github.com/thewh1teagle/rookie/issues/8, There's a workround by starting chrome.exe with specific flags:

chrome.exe --disable-features=LockProfileCookieDatabase

Does it helps?

InstanceGaming commented 1 year ago

My apologies, it was not clear to me #8 also included that the Session cookies aren't persisted until I dug deeper.

I tried adding that argument a while ago multiple times on different builds of Chrome. Never worked, but now it seems to work with these recent versions of Chrome, but with a 2-3 minute delay for the cookies to be flushed to disk. I also confirmed this flag seems to be passed to the browser when using the profile dialog now too.

I will note for future readers, this feature flag is planned to be removed eventually, but in my case this is an acceptable stopgap until I roll this functionality into my browser extension.

Thanks for the quick response.