-
Notifications
You must be signed in to change notification settings - Fork 415
Using default address 127.0.0.1 leads to cookies problems when using Capybara.server_host #503
Comments
It looks like Capybara supports both Can you try setting both to |
Hi, sorry for late. I tried
in different combinations, but didn't found solution. I'll try later when will have some more free time. |
I suppose it's related to #217 |
I'm having similar issues in that using app_host or default_host prevents cookies from being set/retrieved. Resetting them to
Where as setting a subdomain doesn't work:
|
This seems to be a combination of 2 issues - one is #217 which is a phantomjs issue with cookie setting and not yet sure whether we can do anything about that. The second is that the host you're visiting and the host you're setting cookies for have to match. Capybara.server_host is the ip/host that capybara attempts to bind the server to when it's running an app, Capybara.app_host is the url that gets prepended to paths passed to visit and is mainly designed for use when testing external sites. Capybara.default_host is used by the racktest driver (but will be overridden by app_host if set). I'm closing this since the one part of this issue is a configuration problem and not an issue in poltergeist and the other is a duplicate of issue #217 |
Hi, sorry for bad English. Not sure that this is a bug, in my project i'm using
next i wanted to set cookie
i found that this doesn't work.
Next I found the problem. Because of different hosts.
poltergeist-c3d41c7652c4/lib/capybara/poltergeist/driver.rb @ line 218 Capybara::Poltergeist::Driver#set_cookie:
After changing server_host from 'localhost' to '127.0.0.1' all works fine.
The text was updated successfully, but these errors were encountered: