Closed Rub3nCT closed 4 years ago
Thank you for the report and the extensive tests!
Indeed, there was a coercion missing in ->set_cookie
, where the secure
argument did not get converted to a JSON::true or JSON::false value explicitly. I have now added this and will release this in version 0.45 soon.
The other part of your report tries to load a cookie jar from another cookie jar. The ->load()
method only allows this for a file, and that is not implemented here. I have added the ->load_jar
method, which allows you to import (or replace) a premade HTTP::Cookies cookie jar into Chrome.
I hope that is what you intended to do. I will also release this in 0.45 soonish.
Thanks! I just installed current code and all test passed successfully.
->set_cookie is working great, but ->load_jar throws:
Can't locate object method "scan" via package "CookiesNew" (perhaps you forgot to load "CookiesNew"?) at C:/Strawberry/perl/site/lib/HTTP/Cookies/ChromeDevTools.pm line 148.
What I would like to do is to 'import' my current Chrome cookies into my ChromeDevTools session, so I don't have to login every time I use it.
An error is also thrown in HTTP::Cookies::Chrome when saving jar:
DBD::SQLite::st execute failed: datatype mismatch at C:/Strawberry/perl/site/lib/HTTP/Cookies/Chrome.pm line 240.
It would be great to have such option built-in in WWW::Mechanize::Chrome or HTTP::Cookies::ChromeDevTools.
Anyway, I think I can make what I want to achieve following this steps:
Neither ->load()
nor ->load_jar
take a filename (CookiesNew
in your case) as an argument. ->load_jar()
wants a premade HTTP::Cookies object, like HTTP::Cookies::Chrome
. But your idea of saving the cookies you want is a good one. I think loading a HTTP::Cookies file is very simple now that I wrote ->load_jar()
- in fact, ->load()
should now simply work with the filename.
Thanks again for your code that demonstrated the problem very well!
Released as 0.46
Is cookie support working? I tried ->set_cookie and ->load and both throw errors. The same code with HTTP::Cookies is working fine.
I'm I doing something wrong? Test code attached. test.zip