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

set_cookie error with ChromeDriver #233

Open
thbar opened this issue Jan 16, 2019 · 0 comments
Open

set_cookie error with ChromeDriver #233

thbar opened this issue Jan 16, 2019 · 0 comments

Comments

@thbar
Copy link
Contributor

thbar commented Jan 16, 2019

Using hound master version and ChromeDriver 2.45.615355, if I serialise a cookie during a session, then I deserialise it to call set_cookie, I get the following error:

     ** (RuntimeError) unable to set cookie
       (Session info: headless chrome=71.0.3578.98)
       (Driver info: chromedriver=2.45.615355 (d5698f682d8b2742017df6c81e0bd8e6a3063189),platform=Mac OS X 10.14.2 x86_64)

The chromedriver --verbose logs shows:

[XXX][INFO]: [YYYY] RESPONSE AddCookie ERROR unable to set cookie
  (Session info: headless chrome=71.0.3578.98)

For the record, here is the code I'm using:

# after a successful run on a page, I'm capturing the cookies
File.write! cookies_file, :erlang.term_to_binary(cookies())

# then in a later run, I'm doing:
if File.exists?(cookies_file) do
  cookies_file
  |> File.read!
  |> :erlang.binary_to_term
  |> Enum.each fn(x) ->
    set_cookie(x)
  end
end

I'm not sure exactly if this is caused by ChromeDriver itself, or the way hound implements add-cookie (W3C spec: https://w3c.github.io/webdriver/#add-cookie).

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

1 participant