|
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?
|
|
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!
|
|
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?
|
|
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!
|
|
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.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Yes. We understand. That's why we are considering BeforeSendHeader event.
|
|
Rank: Advanced Member Groups: Member
Joined: 7/21/2014 Posts: 129
|
Hi,
Is there a way now to read cookies of a webview?
Thanks.
|
|
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.aspxInside 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!
|
|