Manage your web browser with cookies when you open Internet Explorer

I am creating a C # application that uses a WebBrowser control. This is loading a specific page (which I did not create) that uses a pop-up window and a cookie that determines that it searched for the last "identifier". All this works fine, except when Internet Explorer is open in the background. When Internet Explorer is open in the background, the popup only jumps to the first identifier ever set. It seems that cookies are not stored properly when IE is open.

Structure:

  • The user opens Internet Explorer.
  • A user opens my application.
  • The user searches XXX on the page.
  • User clicks popup. The tooltip displays the correct information.
  • The user searches for XXY on the parent page.
  • User clicks popup. A popup window displays the previous information (incorrect).

As I said, this works great when Internet Explorer is not open.

Does anyone know what can cause this or how to prevent it? Perhaps Internet Explorer is blocking its cookies?

+1
source share
1 answer

As I often do this, I found a problem writing a question. This was a caching issue specific to the WebBrowser control when installing IE8.

URL . :

using System.Runtime.InteropServices;
...
[DllImport("wininet.dll", SetLastError = true)]
private static extern long DeleteUrlCacheEntry(string lpszUrlName);

DeleteURLCacheEntry(pdfURL);
webBrowser.Navigate(pdfURL);
+1

Source: https://habr.com/ru/post/1535106/


All Articles