Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Cookies are not rememberred? #4876

Open
int255 opened this issue Oct 23, 2024 · 1 comment
Open

[Feature]: Cookies are not rememberred? #4876

int255 opened this issue Oct 23, 2024 · 1 comment
Labels
feature request feature request

Comments

@int255
Copy link

int255 commented Oct 23, 2024

Describe the feature/enhancement you need

I created my own web view using MSWebView2 (Win32/C++), but I noticed the cookies are not remembered each time I open up a new WebView2 interface. I looked at the SDK document and didn't find a clue how to tell WebView2 to preserve cookies or discard cookies.

For example I'm testing by navigating my MSWebView2 using https://setcookie.net/, I can set my cookie "aaa=bbb", the cookie is gone if I close my MSWebView2 and re-create a new view, (my application is still opened)

I'm not quite sure if this is an un-supported feature or may be I'm not initializing my MSWebView2 in a correct way? In my opinion, MSWebView2 should preserve the cookie when a new instance is created, and it should give client an API option to "not using cookies" during the construction.

The scenario/use case where you would use this feature

Just generic browsing

How important is this request to you?

Impactful. My app's user experience would be significantly compromised without it.

Suggested implementation

I'm not quite sure if this is an un-supported feature or may be I'm not initializing my MSWebView2 in a correct way? In my opinion, MSWebView2 should preserve the cookie when a new instance is created, and it should give client an API option to "not using cookies" during the construction.

What does your app do? Is there a pending deadline for this request?

My application does web-based sign in.

@int255 int255 added the feature request feature request label Oct 23, 2024
@jls28
Copy link

jls28 commented Oct 23, 2024

From this page I created a simple cookie :

Sent header: Set-Cookie: AAA=BBB; path=/; HttpOnly

the cookie does not persit because this is a session cookie.

but if you add an expiration date this ok :

Sent header: Set-Cookie: AAA=BBB; expires=Thu, 24 Oct 2024 06:45:00 GMT; Max-Age=86366; path=/; HttpOnly

It seem than if you don't supply an expiration date this page create a session cookie.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request feature request
Projects
None yet
Development

No branches or pull requests

2 participants