Skip to content

Give host-only cookies the browser's domain - #1544

Merged
adamtheturtle merged 2 commits into
mainfrom
adamtheturtle/vws-web-tools-issue-1502
Aug 27, 2026
Merged

Give host-only cookies the browser's domain#1544
adamtheturtle merged 2 commits into
mainfrom
adamtheturtle/vws-web-tools-issue-1502

Conversation

@adamtheturtle

Copy link
Copy Markdown
Member

Closes #1502.

_requests_session_from_driver copies the browser's cookies into a requests session. When a cookie had no domain attribute it was set without one, which in requests means a cookie with an empty domain — and a cookie with an empty domain matches no request, so it is never sent. The cookies most likely to arrive that way are host-only cookies for developer.vuforia.com itself, which is exactly the session state these API calls need.

Such cookies now get the host from the browser's current URL.

The cookie is still skipped if there is no host to fall back to, so a driver on about:blank behaves as before rather than setting a domainless cookie.

The _BrowserStateDriver test shell gains a current_url, and the existing assertion for the no-domain cookie now checks it is retrievable for developer.vuforia.com rather than for nothing.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YJDy3qA1LyNTh11zS98ukM

Closes #1502

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YJDy3qA1LyNTh11zS98ukM
``if domain:`` was only ever taken as true, because the test driver
always reported a URL with a hostname, leaving the suite below the
100% coverage gate.

Make the test driver's URL configurable and add a case where a
host-only cookie is read from a URL with no host, which is the
situation the guard exists for.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tz9oY7GG92jssXJFUBDr5B
@adamtheturtle
adamtheturtle force-pushed the adamtheturtle/vws-web-tools-issue-1502 branch from 89070e5 to e386ae2 Compare August 27, 2026 09:09
@adamtheturtle
adamtheturtle merged commit bcaecb2 into main Aug 27, 2026
39 of 93 checks passed
@adamtheturtle
adamtheturtle deleted the adamtheturtle/vws-web-tools-issue-1502 branch August 27, 2026 11:54
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

Successfully merging this pull request may close these issues.

_requests_session_from_driver drops cookies without domain

1 participant