Skip to main content

cookies · setCookies · clearCookies

This tool on every surface: CLI · MCP · Python · JavaScript · Go · Java · .NET

Read, set or clear the current WebView's cookies — the ones its page's URL is sent, HttpOnly ones included, which document.cookie cannot see. These call app_cookies.

cookies​

cookies(): Promise<Cookie[]>

The current WebView's cookies, HttpOnly ones included. Needs a web context.

setCookies​

setCookies(cookies: Cookie[]): Promise<void>

Set each cookie and read the store back.

clearCookies​

clearCookies(name?: string): Promise<void>

Delete the page's cookies, or only those called name.

Examples​

Read the WebView's cookies​

const cookies = await device.cookies()
for (const c of cookies) console.log(c.name, c.domain)

The same call from the command line, mobium cookies, printed on an Android 15 emulator:

no cookies for about:blank

mobium cookies on an Android 15 emulator

mobium cookies on an Android 15 emulator

await device.clearCookies('session')