Welcome Guest Search | Active Topics | Sign In | Register

Winform WebBrowser Cookies Options
Obi
Posted: Tuesday, October 14, 2014 10:09:29 AM
Rank: Newbie
Groups: Member

Joined: 10/14/2014
Posts: 4
Hi,
I'm trying to get cookies of visiting web pages of WebBrowser control.
To do this I'm using webControl.WebView.BeforeRequestLoad event.
In this event e.Request.Cookies.Count value everytime zero even I login to gmail account.

How can I get cookies?
eo_support
Posted: Tuesday, October 14, 2014 12:40:25 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Hi,

Currently the only reliable way to get the cookies before the request is sent is to implement a proxy and then channel all request through the proxy. BeforeRequestLoad event occurs in the very early stage of the request and it occurs before cookies have been attached to the request (in fact one way to attach custom cookie to the request is by adding cookies to e.Request.Cookies collection inside this event). So you won't see any cookies inside this event. We are considering adding a BeforeSendHeader event that will occurs at the last minute before the HTTP request headers are sent, so once that is implemented, you will be able to see the cookies in that event.

Thanks!
Obi
Posted: Tuesday, October 14, 2014 12:47:29 PM
Rank: Newbie
Groups: Member

Joined: 10/14/2014
Posts: 4
Bad news for me :(
I need to get cookies that send to web site not adding new one.
When this release will be available?
eo_support
Posted: Tuesday, October 14, 2014 12:57:41 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Then you need to implement a simple proxy and set EO.WebBrowser.Runtime.Proxy to your proxy. The BeforeSendHeader event is just a new event under consideration. We do not have an ETA on it yet.

Thanks!
Obi
Posted: Friday, October 17, 2014 7:28:16 AM
Rank: Newbie
Groups: Member

Joined: 10/14/2014
Posts: 4
Proxy is not reliable solution.
On https sites you cannot sniff communication between browser and server.
BeforeSendHeader will be greate.
eo_support
Posted: Friday, October 17, 2014 9:32:49 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Yes. We understand. That's why we are considering BeforeSendHeader event.
Fabien
Posted: Tuesday, January 27, 2015 9:24:36 AM
Rank: Advanced Member
Groups: Member

Joined: 7/21/2014
Posts: 129
Hi,

Is there a way now to read cookies of a webview?

Thanks.
eo_support
Posted: Tuesday, January 27, 2015 11:21:49 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Yes. You can handle this event:

http://www.essentialobjects.com/doc/6/eo.webbrowser.webview.afterreceiveheaders.aspx

Inside this event you can read the event argument's Response property, then get the cookies from the Response object. Note this is the cookies sent to the client from the server.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.