Skip to main content

app_cookies

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. Vibium's cookies command, on a WebView: needs a web context, so switch with app_context first. "get" (the default) lists them; "set" sets each of cookies and reads the store back, so one the browser accepted and stored expired is reported, not claimed; "clear" deletes them all, or those called name. An Android app's WebViews share one cookie store, so a cookie set here is set for all of them.

Changes the device, the app or the session: readOnlyHint is false.

Arguments​

NameTypeRequiredWhat it is
actionstring: get, set, clearget (default), set or clear.
cookiesarray of objectWith set: the cookies to set.
devicestringDevice serial to target, e.g. "emulator-5554". Omit when only one device is running.
driverstring: uiautomator2, uiautomator, wdaDriver to use: "uiautomator2" (default for Android; fast, installs a server APK on first use), "uiautomator" (Android, installs nothing, slower, cannot type), or "wda" (WebDriverAgent: iOS simulators and iPhones).
namestringWith clear: delete only the cookies with this name.

Examples​

Each is the arguments of a tools/call request; the first is shown whole.

Read the WebView's cookies​

{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "app_cookies",
"arguments": {}
}
}

On an Android 15 emulator the answer's text was:

no cookies for about:blank

mobium cookies on an Android 15 emulator

mobium cookies on an Android 15 emulator

{
"action": "clear",
"name": "session"
}