0
votes

Does cookies in WebBrowser control acts as normal as in any other browser like Firefox or Chrome? I have made a simple interface for webbrowser control in VB, now im unable to manage login/logout of certain sites.

Some time the logout works and some time dont. Do I need to add additional code for cookie handling for Web browser control or it will do everything itself.

Where do I can read more about WebBrowser control except MSDN.

I found this code:

 webBrowser.Navigate("javascript:void((function(){var a,b,c,e,f;f=0;a=document.cookie.split('; ');for(e=0;e<a.length&&a[e];e++){f++;for(b='.'+location.host;b;b=b.replace(/^(?:%5C.|[^%5C.]+)/,'')){for(c=location.pathname;c;c=c.replace(/.$/,'')){document.cookie=(a[e]+'; domain='+b+'; path='+c+'; expires='+new Date((new Date()).getTime()-1e11).toGMTString());}}}})())")
1

1 Answers

0
votes

A cookie can be marked as "HttpOnly" (attributes are not case-sensitive), to indicate that the cookie is "non-scriptable" and should not be revealed to the client application, for security reasons.

Also your top level document may not have access to the authentication cookie if it is on another domain.