Skip to content

[feat] Add Set Cookie API to WebviewΒ #11691

@murnifine

Description

@murnifine

Describe the problem

I need an API that can set cookies like the API made by electron, or like the chrome extension API

Describe the solution you'd like

    let webview = tauri::webview::WebviewBuilder::new(
        "tauri_main",
        WebviewUrl::External("mywebsite.com".parse().unwrap())
    );

    let res = data;

    webview.set_cookie({
        name: res.name,
        value: res.value,
        domain: res.domain,
        path: res.path,
        expirationDate: res.expirationDate,
        httpOnly: res.httpOnly,
        sameSite: res.sameSite,
        secure: res.secure,
        storeId: e.storeId: res.storeId,
        url: res.url
    });

Alternatives considered

No response

Additional context

https://www.electronjs.org/docs/latest/api/cookies#cookiessetdetails
https://developer.chrome.com/docs/extensions/reference/api/cookies?hl=id#method-set

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions