Sorry, Browser is our class, I missed that while debugging yesterday. Your response pointed me in the right direction, although I'm not quite there yet.
We do navigate to a page (
http://localhost:8081/auth/login/, which loads successfully), and when creating the cookie we set the domain explicitly to "localhost", which fails. If I don't explicitly pass a domain then we're able to successfully create the cookie.
The cookie I'm passing to `add_cookie` looks like:
cookie = {
"name": "hi",
"value": "hello",
"expires": "Tue, 20 Jun 2025 19:07:44 GMT",
"path": "/",
"domain": "localhost",
}
I've tried passing the domain explicitly as
{"domain": "localhost"}
{"domain": "localhost:8081"}
{"domain": "localhost", "port": 8081}
These all fail with "UnableToSetCookieException: Message: unable to set cookie"
If I omit domain completely like:
cookie = {
"name": "hi",
"value": "hello",
"expires": "Tue, 20 Jun 2025 19:07:44 GMT",
"path": "/",
}
It succeeds and when I retrieve the cookie it looks like
{u'domain': u'localhost', u'name': u'hi', u'value': u'hello', u'path': u'/', u'httpOnly': False, u'secure': False}
I could potentially just stop passing along the domain, although I'm hesitant to change our tests since they've been working ok up until this point. Is it possible that there's some problem with dealing with localhost and ports if we pass domain explicitly?