You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
We have the following code:
List<Header> headers = new List<Header>();
headers.Add(new Header("Cookie", "Param1=Val1;Param2=Val2"));
webKitBrowser.Navigate("http://SampleUrl.com/Page1.aspx", headers);
What is the expected output? What do you see instead?
Cookies present during first request. If user clicks any link(For page2.aspx)
in the "SampleUrl.com/Page1.aspx" page then during this request what ever
headers we have set during the initial navigate method call are not present.
What version of the product are you using? On what operating system?
OpenWebkitSharp Version:OpenWebKitSharp 2.9 stable.
VS: 2010,
WPF,
Operating System: Windows 7 Enterprise SP1.
Please provide any additional information below.
Do we need to set headers for every navigation? If so, How to do that?
How to set cookies to webkitbrowser document?
Original issue reported on code.google.com by [email protected] on 9 Oct 2012 at 2:18
The text was updated successfully, but these errors were encountered:
You can do this probably only by modifying the source of OpenWebKitSharp. Look
inside the frameLoadDelegate events and find the one that corresponds to the
time just before the request is sent. Then, use request.setHeader to add the
header you want. Alternatively, you can look inside WebResourceLoadDelegate.cs
and find the willSendRequest method. Inside it, before the lines return req;
and return request; modify the request according to your own needs. This will
change the headers of all request sent for all resources though.
Fixed, it was simple. You have to tell the request to handle the cookies. You
have a WebKit.Interop.IWebURLRequest, convert it to its mutable version so you
can use the proper method:
WebKit.Interop.WebMutableURLRequest mutableRequest = request.mutableCopy();
mutableRequest.setHTTPShouldHandleCookies(1);
request = mutableRequest;
Original issue reported on code.google.com by
[email protected]
on 9 Oct 2012 at 2:18The text was updated successfully, but these errors were encountered: