4

We use IWebBrowser2 to display web pages but it seems to not able to see the same cookies as normal IE sees.

For example, if I log in Facebook in IE and check on Remember Me, the next time I open IE and go to Facebook then I will still stay logged in.

However, if I use IWebBrowser2 to go to Facebook, I am not logged in anymore.

It seems to me IWebBrowser2 and IE use two different sets of cookies? If so, how do I make IWebBrowser2 sees the same cookies as IE?

Thank you very much.

TopQ
  • 175
  • 3
  • 13

1 Answers1

1

What you experience seems to be caused by Loosely Coupled IE (LCIE). This feature runs every tab in its own process with low integrity level. And this seems to prevent cookie sharing, at least if your program runs with medium or high integrity level. (Use Process Explorer to view the integrity levels of processes.)

If you disable per-tab processes so that every tab runs inside the main IE process (which has medium integrity level) then cookie sharing between this IE and IWebBrowser2 works. To disable you have to create/edit a registry key. You can adjust the number of processes used for tabs here:

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\TabProcGrowth

Set it to 0 and you effectively disable the feature at all. If the key doesn't exist create it. (Source.)

I am not sure about the security implications of doing this. And one tab crashing will take down the whole IE process. But it might give you a go in the right direction.

Heinrich Ulbricht
  • 10,064
  • 4
  • 54
  • 85