Welcome Guest Search | Active Topics | Sign In | Register

How to use CookieManager.GetCookie() Options
Nifeng
Posted: Saturday, December 29, 2018 4:23:13 AM
Rank: Newbie
Groups: Member

Joined: 10/21/2018
Posts: 5
I created a console application , then only the following code :

//Create a ThreadRunner object
ThreadRunner threadRunner = new ThreadRunner();

//Create a WebView through the ThreadRunner
WebView webView = threadRunner.CreateWebView();
Console.WriteLine(webView.Engine.Version);
if (webView.Engine.IsDefault)
{
Console.WriteLine(webView.Engine.State.ToString());
}
Console.WriteLine("设置cookie");
Cookie cookie = new Cookie("aaa", "aaa");
cookie.Expires = DateTime.Parse("2020-10-10");
try
{
webView.Engine.CookieManager.SetCookie("www.google.com", cookie);
}
catch(Exception e)
{

}

the message is showed on console "62.0.3302.9" "Running"

and then stoped at the line "webView.Engine.CookieManager.SetCookie("www.google.com", cookie);" without any information . looks like it's in a dead loop.
what's wrong with my code ?
Nifeng
Posted: Saturday, December 29, 2018 5:32:41 AM
Rank: Newbie
Groups: Member

Joined: 10/21/2018
Posts: 5
I tried again and again. it still runs uncorrectly
eo_support
Posted: Thursday, January 3, 2019 8:11:43 AM
Rank: Administration
Groups: Administration

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

We have confirmed this to be a bug. To avoid the problem, you must use a valid Url with protocol. For example, "http://www.google.com", not just "www.google.com". This is necessary because cookies are protocol sensitive. As such when you do not specify protocol, the operation would fail. However it should fail instead of hang. This will be fixed in our next build.

Thanks!
Nifeng
Posted: Friday, January 4, 2019 12:54:54 PM
Rank: Newbie
Groups: Member

Joined: 10/21/2018
Posts: 5
Got it ! 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.