Close and then open a new tab page or window asks authentication

Neha 0 Reputation points
2025-01-11T04:26:32.7333333+00:00

I am trying to embed a webform application in WinForm using Webview2 control. The new window opens in a tab page with webview2 child ( e.handled=true). But when destroying the child tab wm_destroy is not calling properly. so each time while open a new window/tab page I have to authenticate the page. How can I resolve this? Thanks in advance

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
5,700 questions
Universal Windows Platform (UWP)
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,185 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 69,121 Reputation points
    2025-01-11T19:26:52.34+00:00

    By default webviews have their session and app data, so session cookies are not shared. To share between webviews, you must use the same persistent store for all webviews. See shared data in:

    https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/user-data-folder?tabs=win32

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.