browser_set_cookie
Set cookies in the browser via CDP, including httpOnly ones, to support security tests like IDOR and session fixation.
Instructions
Set a cookie in the browser via CDP. Can set httpOnly cookies (unlike document.cookie in JS).
PREREQUISITE: browser_open and browser_go must have been called first (need a page loaded for domain).
USE CASES:
IDOR testing: Set another user's session cookie to test access controls
Session fixation: Pre-set a known session ID
Testing httpOnly bypass: Inject cookies that JavaScript can't normally set
Args: name: Cookie name (e.g. "session_id", "auth_token") value: Cookie value domain: Cookie domain (default: current page's domain). Must match or be a parent of the page domain. path: Cookie path (default: "/") http_only: Set the HttpOnly flag — makes cookie invisible to document.cookie (default false) secure: Set the Secure flag — cookie only sent over HTTPS (default false) session_name: Browser session to use (default: "default")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| path | No | / | |
| value | Yes | ||
| domain | No | ||
| secure | No | ||
| tab_id | No | ||
| http_only | No | ||
| session_name | No | default |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |