Clearing WebBrowser control's cookies for all sites WITHOUT clearing for IE itself

后端 未结 2 435
说谎
说谎 2021-02-01 22:19

EDIT: As far as I know, there is no solution to this problem, making it yet another testament to the fact that one should not use C#\'s WebBrowser. We ended up with a warning si

相关标签:
2条回答
  • 2021-02-01 22:48

    Is it necessary to have the cookies functional in IE at the same time? Is it possible to "restore" the original cookies back to IE after your program runs?

    UPDATE:

    Another idea:

    I wonder what would happen if you ran your program under a different user account, via Impersonation. It's possible that it would store those cookies under a different Windows profile...

    0 讨论(0)
  • 2021-02-01 22:51

    That comment at How to set and delete cookies from WebBrowser Control for arbitrary domains is a mistake. The WinInet cache folder setting is apparently not in IE settings but is a Shell folder setting, since IDocHostUIHandler2 can only customize settings stored in IE's registry key it is not useful for this task. I don't know a way to customize the folder location except to hook all WinInet APIs (and stuck with updating application to accommodate future WinInet APIs), which is not easy in C#. I will update the old post now.

    0 讨论(0)
提交回复
热议问题