I'm having a problem here with authorization on a site. I'm using a headless browser PhantomJS on top of Selenium. What I do:
driver.get('https://foo.com')
# some instructions to log in
# foo.com makes some requests to https://bar.foo.com and sets cookies for https://bar.foo.com domain
driver.get_cookies()
# no cookies for https://bar.foo.com
# any requests to https://foo.com are not autorized because the cookies from https://bar.foo.com are the ones that are needed, but not provided
Is there any workaround for it? Been searching to fix the problem for a long time and no success.
One more note: for example, chromedriver collects all of the cookies received from AJAX requests to subdomains, while phantomjs doesn't do that.