|
Rank: Advanced Member Groups: Member
Joined: 9/20/2016 Posts: 73
|
Hi! I got an exception when I tried to get a cookies:
Unhandled Exception: System.ArgumentOutOfRangeException: Not a valid Win32 FileTime. Parameter name: fileTime in System.DateTime.FromFileTimeUtc(Int64 fileTime) in System.DateTime.FromFileTime(Int64 fileTime) in EO.Internal.samx.wgmp(String ej, Boolean ek) in EO.WebEngine.CookieManager.GetCookies(String url, Boolean includeHttpOnly)
|
|
Rank: Advanced Member Groups: Member
Joined: 9/20/2016 Posts: 73
|
Some interesting facts. Found this on stackoverflow.com: "So, after long researches on this topic, here is the solution: Chrome's cookies timestap's epoch starts 1601-01-01T00:00:00Z (Why? Because.) So, it's 11644473600 seconds before the UNIX epoch. To convert chrome's timestamp to UNIX, you need to: Devide the actual timestamp (in my case it's expires_utc column in cookies table) by 1000000 // And someone should explain me why. Subtract 11644473600 DONE! Now you got UNIX timestamp. "
Code: C#
long chromeTimestampNow = (long)((DateTime.UtcNow.Subtract(new DateTime(1601, 1, 1))).TotalMilliseconds*1000);
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
Is it possible for you to provide an Url with this sepcific cookie so that we can debug it here? This does not have anything to do with Unix epoch. The value Chrome uses internally is Windows epoch. However Chrome stores the value in microsecond, while Windows uses 100-nanosecond. Both are 64 bits. So in theory Chrome can store a larger time value than Windows. In that case you will get an out of range exception.
If you can produce a test cookie that can cause this error, we can debug it here and maybe change our code to automatically use the maxmium allowed value instead of throwing an out of range exception. This would alter the true expiration date of the cookie, but in practice it should not make any difference because the time would be far away in the future.
Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 9/20/2016 Posts: 73
|
Yes, I can. The problematic site: heedyou.com I am unable to provide a specific cookie because I am trying to get the full collection:
Code: C#
var cooks = wc.WebView.Engine.CookieManager.GetCookies("", false);
Thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Thanks for the additional information. There is indeed a cookie whose expiration date is set to year 10000. .NET DateTime.MaxValue is year 9999. We will change our code to use DateTime.MaxValue instead for such cases in our next build.
|
|
Rank: Advanced Member Groups: Member
Joined: 9/20/2016 Posts: 73
|
Ок, thank you!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
This is just to let you know that we have posted a new build that should resolve this issue. You can download the new build from our download page. Please take a look and let us know how it goes.
Thanks!
|
|