HTTP.jl icon indicating copy to clipboard operation
HTTP.jl copied to clipboard

Save and load cookie jar to file

Open olegshtch opened this issue 3 years ago • 1 comments

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

olegshtch avatar Oct 03 '22 19:10 olegshtch

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)

quinnj avatar Oct 04 '22 05:10 quinnj