For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/api/elements/built-in/webview.md.
interface CookiesSetParams { /** * The domain of the cookie. Empty by default if omitted * @PC */ domain?: string; /** * The expiration date of the cookie as the number of seconds since the UNIX epoch * @PC */ expirationDate?: number; /** * Whether the cookie should be marked as HTTP only * @PC * @defaultValue false */ httpOnly?: boolean; /** * The name of the cookie * @PC */ name: string; /** * The path of the cookie. Empty by default if omitted * @PC */ path?: string; /** * The Same Site policy to apply to this cookie. Can be unspecified, no_restriction, lax or strict * @PC * @defaultValue 'lax' */ sameSite?: string; /** * Whether the cookie should be marked as secure * @PC * @defaultValue false */ secure?: boolean; /** * The URL to associate the cookie with * @PC */ url: string; /** * The value of the cookie. Empty by default if omitted * @PC */ value?: string;}const params: CookiesSetParams = { domain: 'example.com', expirationDate: Math.floor(Date.now() / 1000) + 60 * 60 * 24 * 30, httpOnly: true, name: 'session', path: '/', sameSite: 'lax', secure: true, url: 'https://example.com', value: 'hello' };lynx.createSelectorQuery() .select('#id') .invoke({ method: 'cookies.set', params, success: function (res) {}, fail: function (res) {}, }) .exec();
Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.