Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save and load cookie jar to file #931

Open
olegshtch opened this issue Oct 3, 2022 · 1 comment
Open

Save and load cookie jar to file #931

olegshtch opened this issue Oct 3, 2022 · 1 comment

Comments

@olegshtch
Copy link

Before update I could save cookies to CSV file as is and restore them from the file by creating Dict and populate it with created cookies. Now I had to generate Headers with Set-Cookie headers for it.

Could it be solved by adding constructor to CookieJar which accepts initial cookies?

  • Julia 1.8.2
  • HTTP 1.4.0
  • MbedTLS.jl 1.1.6
@quinnj
Copy link
Member

quinnj commented Oct 4, 2022

Yeah, this would be easy to provide. Note you can do:

jar = HTTP.CookieJar()
dict = jar.entries

But I'd also take a PR to add a constructor like:

CookieJar(entries::Dict{String, Dict{String, Cookie}}) = CookieJar(ReentrantLock(), entries)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants