Sessions & Cookies
Sessions & Cookies
A Voyager session is an authenticated LinkedIn connection backed by browser cookies. You provide cookies from your real LinkedIn browser session; Voyager maintains them in a headless Chromium instance that makes API calls on your behalf.
Syncing Cookies
Use POST /api/session to sync your LinkedIn cookies:
Required Cookies
Optional Parameters
Always include userAgent when syncing cookies. LinkedIn compares the User-Agent from the cookie’s origin browser against the requesting browser. A mismatch can trigger session invalidation or redirect loops.
Session Validation
After syncing, Voyager automatically probes LinkedIn (12-second timeout) and returns the validation result:
If the probe fails:
Checking Session Health
Use GET /api/session/capabilities for a comprehensive session check:
GET /api/health/tenant is a lighter health check that does not probe LinkedIn. Use it for frequent polling. Use GET /api/session/capabilities when you need to confirm the session is actually working.
Cookie Hot-Swap
You can re-sync cookies at any time without interrupting service. Voyager:
- Clears existing cookies from the browser context
- Sets the new cookies
- Validates the new session
- Continues using the same browser page (no restart needed)
If a phantom or action is currently running, the cookie swap waits until it completes to avoid mid-operation disruption.
Session Expiry
LinkedIn cookies typically last 1-3 months but can expire earlier if:
- LinkedIn detects suspicious activity
- You log out from the browser
- LinkedIn forces a password reset
- The IP address changes significantly
Detection
Voyager detects expired sessions in three ways:
- On API call — Returns
401 SESSION_EXPIREDwhen LinkedIn rejects the session - Background polling — PollService checks messages/invitations every 5 minutes. If all checks fail with session errors, it emits a
session_expiredwebhook and pauses polling for that user - On sync —
POST /api/sessionvalidates the new cookies immediately
Recovery
When a session expires:
- Log in to LinkedIn in your browser
- Use the Chrome extension to export fresh cookies (or manually extract
li_atandJSESSIONID) - Call
POST /api/sessionwith the new cookies - Voyager validates and resumes normal operation
Export Current Cookies
To export the cookies Voyager currently holds (useful for debugging):
Browser Architecture
Voyager uses per-country browser pooling. Each unique country code gets its own Chromium process; users in the same country share the process via isolated BrowserContexts (~70MB each vs. 300MB per process). The browser sits on /robots.txt (no JavaScript, no detection) and makes LinkedIn API calls via same-origin fetch().
The main API page is never navigated away from /robots.txt. Operations that need DOM interaction (rare fallback paths) use disposable temp pages that are closed after use.