How can I clear cookies from MS Edge programmatically using C#.NET

akshitjain 1 Reputation point

Like in IE we use rundll32.exe for clearing cache and cookies.

For Latest version of Edge I tried using this path : LocalAppData\Microsoft\Edge\User Data\Default.

In this path I tried deleting the cookies file but issue is that after deleting the file when I manually try to clear cookies from browser it still shows all the cookies..

What can I do to clear cookies from Edge(ver 96 +)

Microsoft Edge
Microsoft Edge
A Microsoft cross-platform web browser that provides privacy, learning, and accessibility tools.
2,040 questions
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.
9,981 questions
{count} votes

1 answer

Sort by: Most helpful
  1. XuDong Peng-MSFT 8,286 Reputation points Microsoft Vendor

    Hi @17383778,

    Based on what has been mentioned, I did a simple test on it, and I found that deleting %LOCALAPPDATA%\Microsoft\Edge\User Data\Default\Cookies is indeed effective, but you need to disable this feature Allow sites to save and read cookie data (recommended), like this:

    Hope this can help.

    Best regards,
    Xudong Peng

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.