Synopsis
Retrieve cookies from the current page using Chrome DevTools Protocol’s Network.getCookies method.Description
Thenetwork getCookies command retrieves all cookies accessible from the current page context. Returns cookies for the current page’s domain and any parent domains, including HttpOnly and Secure cookies.
This command directly invokes CDP’s Network.getCookies method and displays results in a human-readable format.
Options
Filter cookies by URL. Only returns cookies that would be sent with a request to this URL.Example:
--url https://example.com/apiOutput results in JSON format for programmatic consumption.
Output Format
Human-readable (default)
JSON Format
Cookie Properties
name
Cookie name/key.value
Cookie value. May contain JSON or other structured data.domain
Domain scope for the cookie. Leading dot (.example.com) indicates cookie is valid for all subdomains.
path
URL path scope. Cookie is only sent for requests matching this path prefix.expires
Expiration timestamp (Unix epoch seconds). Special values:Session- Cookie expires when browser closes (expires = -1 in JSON)- ISO date string - Persistent cookie expiration time
httpOnly
IfYes, cookie is inaccessible to JavaScript (document.cookie). HTTP-only cookies are only sent in HTTP requests.
secure
IfYes, cookie is only sent over HTTPS connections.
sameSite
Cross-site request behavior:Strict- Cookie never sent in cross-site requestsLax- Cookie sent in top-level navigation (clicked links) but not embedded requestsNone- Cookie sent in all cross-site requests (requires Secure flag)
Examples
List all cookies
List cookies for specific URL
Get cookies as JSON
Extract specific cookie value with jq
Check if authentication cookie exists
Find insecure cookies
List HttpOnly cookies
Export cookies to file
Use Cases
Debug authentication issues
Verify cookie security settings
Check cookie expiration
Audit SameSite configuration
Exit Codes
Cookies retrieved successfully (may return empty list)
No active session found
Failed to connect to daemon
CDP method call timed out
Tips
See Also
- network headers - Inspect HTTP headers (including Set-Cookie)
- cdp - Execute arbitrary CDP methods
- network list - List network requests

