Answered by:
Cookies not going through with WebView.navigateWithHttpRequestMessage()

Question
-
var webview = document.getElementById("WebView"); var httpRequestMessage = new Windows.Web.Http.HttpRequestMessage( Windows.Web.Http.HttpMethod.get, new Windows.Foundation.Uri("https://someurl.com") ); httpRequestMessage.headers.cookie.tryParseAdd("onecookie=a;somecookie=b"); webview.navigateWithHttpRequestMessage(httpRequestMessage);
This code is called after the complete promise after WinJS.UI.processAll(). In fiddler I see that the request looks like this:
GET https://someurl.com HTTP/1.1 Accept: text/html, application/xhtml+xml, */* Accept-Language: en-US X-P2P-PeerDist: Version=1.1 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; Touch; MSAppHost/2.0; rv:11.0) like Gecko UA-CPU: AMD64 Accept-Encoding: gzip, deflate, peerdist Host: someurl.com Connection: Keep-Alive X-P2P-PeerDistEx: MinContentInformation=1.0, MaxContentInformation=1.0
The webview is defined in a `HubSection` in html as follows:
<x-ms-webview id="WebView" width="100%" height="100%" />
This must be a bug. I step through and the cookies are set correctly, but the webview just seems to ignore them. Any workarounds?
- Edited by Caleb Jares Wednesday, May 21, 2014 8:49 PM
Wednesday, May 21, 2014 7:39 PM
Answers
-
Check out this blog: http://blogs.msdn.com/b/wsdevsol/archive/2014/04/03/ten-things-you-need-to-know-about-webview-_2d00_-an-update-for-windows-8.1.aspx ,especially the section: "Had it have it : NavigateWithHttpRequestMessage"
Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog
- Edited by Prashant H PhadkeMicrosoft employee, Moderator Tuesday, May 27, 2014 11:11 PM corrected the link by removing the comma
- Marked as answer by Prashant H PhadkeMicrosoft employee, Moderator Tuesday, May 27, 2014 11:11 PM
Wednesday, May 21, 2014 11:05 PMModerator -
That link doesn't work; try this one instead:
Network Developer Experience Team (Microsoft)
- Marked as answer by Prashant H PhadkeMicrosoft employee, Moderator Tuesday, May 27, 2014 11:11 PM
Thursday, May 22, 2014 9:37 PM
All replies
-
Check out this blog: http://blogs.msdn.com/b/wsdevsol/archive/2014/04/03/ten-things-you-need-to-know-about-webview-_2d00_-an-update-for-windows-8.1.aspx ,especially the section: "Had it have it : NavigateWithHttpRequestMessage"
Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog
- Edited by Prashant H PhadkeMicrosoft employee, Moderator Tuesday, May 27, 2014 11:11 PM corrected the link by removing the comma
- Marked as answer by Prashant H PhadkeMicrosoft employee, Moderator Tuesday, May 27, 2014 11:11 PM
Wednesday, May 21, 2014 11:05 PMModerator -
That link doesn't work; try this one instead:
Network Developer Experience Team (Microsoft)
- Marked as answer by Prashant H PhadkeMicrosoft employee, Moderator Tuesday, May 27, 2014 11:11 PM
Thursday, May 22, 2014 9:37 PM