Menu

#81 getCookie returns null when using Edge

v1.0_(example)
open
nobody
Cookie (1)
1
2022-05-16
2022-04-26
No

When using the IE browser, I am able to retrieve a Cookie value for the current webpage that is loaded. However, when I am use edge (applying -Dorg.eclipse.swt.browser.DefaultType=edge), the cookie returns null. The call to get the cookie is JWebBrowser.getCookie(url, "SMSESSION")

Discussion

  • Thomas Wilde

    Thomas Wilde - 2022-04-26

    Also, the reason why I am using the edge browser is because I assume we will be required to when IE retires on June 15, 2022.

     
  • Thomas Wilde

    Thomas Wilde - 2022-04-26

    After looking at the SendingCommands demo, I was able to create a workaround by executing the following javascript after the page was loaded:

    webBrowser.executeJavascriptWithResult("sendNSCommand(document.cookie);")

    Using the command received function, I got the web page cookies and was able to parse them. This should work just fine, but it still seems strange that the getCookie function simply returns null.

     
  • Thomas Wilde

    Thomas Wilde - 2022-04-26

    It did work on JDK 11 with the latest swt. Still can't get it to work on JDK 8 though.

     
  • Christopher Deckers

    Hi Thomas,

    IE retires, but I don't know if the COM component that SWT uses will cease to work. I think I read that it will continue to work for several years.

    About the cookies that do not work, this is because Edge has some limitations and thus SWT cannot implement all APIs:
    https://www.eclipse.org/swt/faq.php#edgelimitations

    You are saying that something is not working with JDK8. What exactly is not working?

    Cheers,
    -Christopher

     
    • aakif shamsi

      aakif shamsi - 2022-05-16

      @chrriis,
      when you say the COM Component that SWT uses will continue to work for several years, could you please cite some references that say so?

      Also, could you maybe give some technical details to this "COM Component" which your Library uses?

       

Log in to post a comment.

MongoDB Logo MongoDB