How add cookie to webbrowser control ?

G

Guest

Hi !

I am trying to add a cookie to a webbrowser component hosted inside a
windows forms window and perform a call.

ala, browser.Navigate( xxx,yyy, zzz, strHeader)

where strHeader contains "Cookie: key=value\n\r"

But, the control seems to ignore this header ( it's not seen on the
serverside)

Can I in any way add a cookie to this browser component ??
ie altering the string in any way ??
using underlying interface/component ??

Ideas ??

Thanks

Claes R.
 
K

Ken Wilson

On Tue, 23 May 2006 08:46:02 -0700, claes R <claes
Hi !

I am trying to add a cookie to a webbrowser component hosted inside a
windows forms window and perform a call.

ala, browser.Navigate( xxx,yyy, zzz, strHeader)

where strHeader contains "Cookie: key=value\n\r"

But, the control seems to ignore this header ( it's not seen on the
serverside)

Can I in any way add a cookie to this browser component ??
ie altering the string in any way ??
using underlying interface/component ??

Ideas ??

Thanks

Claes R.
I'm not sure if this is what you want but I have to make a call to a
server from a WebBrowser control and need to add a cookie to support
that I've already been authenticated. I get the cookie from the
HtmlDocument that is being held by the WebBrowser after all the login
activity has finished. I then use UriBuilder to append an '&' and the
contents of the cookie, i.e. 'something=somethingelse', to the URI's
query section.

This assumes you have the cookie already and just need a simple
mechanism to get it back to the server while making your request.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top