DocsCookie Managementhttp_session_set_cookies

http_session_set_cookies

http_session_set_cookies

Import cookies into a session. Accepts either a JSON array of cookie objects with domain, name, value, path fields, or Netscape cookie format lines. Useful for importing cookies from browser contexts (browser_get_cookies) into HTTP sessions for non-DOM operations.

When to use http_session_set_cookies

Use http_session_set_cookies when you need to read, set, or clear cookies to manage session state. It is part of Owl Browser's Cookie Management toolset and runs inside a self-hosted, source-level stealth engine, so every call inherits the same undetectable browser fingerprint as the rest of your automation — no separate anti-detect setup required.

Usage Example

123456789101112
import asyncio
from owl_browser import OwlBrowser, RemoteConfig
# Async usage
async with OwlBrowser(config) as browser:
context = await browser.create_context()
context_id = context["context_id"]
await browser.http_session_set_cookies(
session_id="value",
cookies="value"
)

Parameters

Required

session_idstringrequired

The session ID.

cookiesstringrequired

Cookies to set. Accepts either a JSON array of cookie objects (e.g., '[{"domain": ".example.com", "name": "session", "value": "abc123", "path": "/"}]') or Netscape cookie format lines.

Response

Returns a JSON object with the operation result.

{
  "success": true,
  "result": <value>
}

Frequently Asked Questions

What does http_session_set_cookies do?

Import cookies into a session. Accepts either a JSON array of cookie objects with domain, name, value, path fields, or Netscape cookie format lines. Useful for importing cookies from browser contexts (browser_get_cookies) into HTTP sessions for non-DOM operations. It belongs to Owl Browser's Cookie Management category and is available through the REST API, the Python SDK (browser.http_session_set_cookies()), the Node.js SDK, and the MCP server.

What parameters does http_session_set_cookies accept?

http_session_set_cookies accepts 2 required parameters (session_id, cookies) and 0 optional parameters. All parameters are sent as JSON in a POST request to /api/execute/http_session_set_cookies.

Is http_session_set_cookies detectable by anti-bot systems like Cloudflare or DataDome?

No. http_session_set_cookies executes inside Owl Browser's Chromium engine, which applies fingerprint spoofing at the C++ source level rather than through JavaScript patches. Every tool call shares the same consistent, human-like fingerprint, so anti-bot systems such as Cloudflare, DataDome, and Akamai see an ordinary browser.

Related Tools

Browse the full Owl Browser API reference or get started with the Python SDK and Node.js SDK.