Your headless browser has as many cookie jars as it has CDP connections
Описание и применение
В headless‑браузере каждая связь CDP имеет свой собственный cookie‑jar. При использовании нескольких соединений агент видит пустой jar, что приводит к аутентификации как анонимный пользователь. Решение – использовать один CDP‑соединение, через которое агент отправляет команды, а relay управляет cookie‑jar.
Задача
Authenticated headless agents lost session state because cookie jars were scoped per CDP connection, not per browser instance, causing navigation to appear logged out.
Результат
By consolidating CDP connections, the agent consistently accessed the correct cookie jar, eliminating authentication failures and improving security posture.
Рабочий процесс
- 1. Export cookies from a logged‑in desktop session via Chrome extension.
- 2. Relay injects cookies into Lightpanda on its CDP connection.
- 3. Agent sends CDP commands to the relay (not directly to :9222).
- 4. Relay replays commands on the single connection, preserving the cookie jar.
- 5. Agent verifies state on the same connection before navigation.
Доказательства
Lightpanda scopes its cookie jar per CDP connection, not per browser instance.
The version that ships today has the relay own the only CDP connection permanently.
- Дата записи: 2026-09-15T14:30:16.067Z