Can't delete cookies

Fixed Issue #5751773

Details

Created
Dec 8, 2015
Privacy
This issue is public.
Fixed in build #
16.16234
Reports
Reported by 17 people

Sign in to watch or report this issue.

Steps to reproduce

Lots of people like to start the browser then delete all cookies. This works great in Chrome (which starts at data;) but fails in Edge (which starts at about:start, but also fails with about:blank)

webDriver =
new

EdgeDriver
(
@"C:\Program Files (x86)\Microsoft Web
Driver"
);

                   
webDriver.Manage().Timeouts().SetPageLoadTimeout(
new

TimeSpan
(0, 0, 0, 0, 120000));

webDriver.Manage().Window.Maximize();

webDriver.Manage().Cookies.DeleteAllCookies();

NOTICE: You get an exception

EXPECT: it should work

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Mara P.”

      Changed Assigned To from “Mara P.” to “Ben B.”

      Changed Status to “Confirmed”

      Changed Title from “cannot delete cookies from Edge via webdriver when navigated to about:start or about:blank” to “cannot delete cookies from Edge via webdriver when navigated to about:start or about:blank (deleteAllCookies)”

      Changed Title from “cannot delete cookies from Edge via webdriver when navigated to about:start or about:blank (deleteAllCookies)” to “cannot delete cookies from Edge via webdriver when navigated to about:start or about:blank (deleteAllCookies)”

    • Wanted to add that it doesn’t matter if you are on the start page or not. There is an error whenever attempting to delete a cookie. Backtrace from Ruby code; Note that you can add a cookie, but not delete it:

      -> POST session/A6841A76-907C-4067-BC2C-47E6FE333869/cookie

      http://localhost:17556/session/A6841A76-907C-4067-BC2C-47E6FE333869/cookie | {"cookie":{"name":"foo","value":"bar","path":"/","secure":false}}
      <- {"sessionId":"A6841A76-907C-4067-BC2C-47E6FE333869","status":0,"value":null}
      -> DELETE session/A6841A76-907C-4067-BC2C-47E6FE333869/cookie/foo
      <- {"sessionId":"A6841A76-907C-4067-BC2C-47E6FE333869","status":13,"value":{"message":"Unknown error"}}

    • Has there been a fix for this? I’m experiencing it with Selenium WebDriver 2.52, MS Edge 10586, Java bindings

    • in general most web drivers need to have a page open to clear cookies. You may bypass it by several simple tricks. For Edge the following functions properly (C#):

                          ((EdgeDriver)driver).Navigate().GoToUrl(page);
                          try
                          {
                              ((EdgeDriver)driver).Manage().Cookies.DeleteAllCookies();
                          }
                          catch (Exception e)
                          {
      
                          }
                          ((EdgeDriver)driver).Navigate().Refresh();
      

      Regards
      bp

    • Microsoft Edge Team

      Changed Assigned To from “Ben B.” to “Clay M.”

      Changed Assigned To from “Clay M.” to “Stanley H.”

    • Just to clarify, this problem is NOT limited to just about:blank and about:start, right? Contrary to the bug’s title. It sounded to me like that’s what Titus was saying, anyway, and that is consistent with my experience now with build 15063 – I can visit arbitrary domains and set cookies, but can’t delete them.

    • That is correct, since I can’t edit the issue, I tried to clarify in the first comment
      Also, I haven’t checked this since January, so I have no input on its current status

    • Microsoft Edge Team

      Changed Title from “cannot delete cookies from Edge via webdriver when navigated to about:start or about:blank (deleteAllCookies)” to “Cannot delete cookies”

      Changed Title from “Cannot delete cookies” to “Can't delete cookies”

    • Is this an issue that MS Edge team is working on? I see it is marked as External and I wasn’t sure if that meant it was not being worked on (and since it’s been open since 2015.

      Thanks

    • Microsoft Edge Team

      Changed Assigned To from “Stanley H.” to “John J.”

      Changed Status from “Confirmed” to “Fixed”

    • This is fixed and should show up in future insider builds.

    • when is this going to be shipped?

    • Hi, just tried this with Edgew build 15063 but not fixed. Do I need a different version? Has this been released yet?

    • I’m using the Edge Nuget package WebDriver’s Selenium.WebDriver.MicrosoftDriver, version 16.16299.0 with target framework net452.

      Any estimate on what version will contain a fix for this problem?

    • Update: I am not seeing an exception get thrown in this version. The cookies simply do not get deleted from the Cookies list.

    • The issue seems to be addressed for me in Edge 17

    • Hello,

      I seem to be having the same problem with Microsoft Edge 42.17134.1.0 / Microsoft EdgeHTML 17.17134 and MicrosoftWebDriver Release 17134.

      Whenever I try to perform

      Driver.Manage().Cookies.DeleteCookieNamed( “SessionAuthToken” )

      or

      Driver.Manage().Cookies.DeleteAllCookies(),

      the result is a "OpenQA.Selenium.WebDriverException: 'Unknown error’". Is this still an issue despite the “Fixed in build #16.16234” status or are we doing something wrong?

      Best regards & thanks in advance,
      H.

    • While running tests:

      GET /session/0606C275-154A-4884-BC95-A90DBE7679A8/cookie returns:

      {
          "sessionId": "0606C275-154A-4884-BC95-A90DBE7679A8",
          "status": 0,
          "value": [
              {
                  "name": ".AspNet.Consent",
                  "value": "yes",
                  "path": "/",
                  "domain": "localhost",
                  "expiry": 1577396997,
                  "secure": false,
                  "httpOnly": false
              }
          ]
      }
      

      DELETE /session/0606C275-154A-4884-BC95-A90DBE7679A8/cookie returns:

      {
          "sessionId": "0606C275-154A-4884-BC95-A90DBE7679A8",
          "status": 13,
          "value": {
              "message": "Unknown error"
          }
      }
      

      All calls are made after visit localhost.
      Invoke Driver.Manage().Cookies.DeleteAllCookies() doesn’t work.

      The issue is still not fixed for me.

      Release 17134
      Microsoft Edge 42.17134.1.0
      Microsoft EdgeHTML 17.17134

      NuGet Version: 17.17134.0

    • A workaround could be to start edge in Private Mode:

      var options = new EdgeOptions();
      options.AddAdditionalCapability("InPrivate", true);
      
      var driver = new EdgeDriver(this.GetExecutingDirectory(), options);
      
    • Please reopen this issue- as Mihail Y. wrote, bug still exist in
      42.17134.1.0
      Microsoft EdgeHTML 17.17134

    You need to sign in to your Microsoft account to add a comment.

    Sign in