Logo
My Account |  Site Map | Contact Us  
Welcome Guest Search | Active Topics | Sign In | Register

Exception while getting Cookies (21.1.11.0) Options
rainstuff
Posted: Monday, May 31, 2021 10:18:37 AM
Rank: Advanced Member
Groups: Member

Joined: 9/20/2016
Posts: 59
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)
rainstuff
Posted: Tuesday, June 1, 2021 4:00:18 AM
Rank: Advanced Member
Groups: Member

Joined: 9/20/2016
Posts: 59
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);
eo_support
Posted: Tuesday, June 1, 2021 1:50:10 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 22,900
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!
rainstuff
Posted: Tuesday, June 1, 2021 2:14:23 PM
Rank: Advanced Member
Groups: Member

Joined: 9/20/2016
Posts: 59
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!
eo_support
Posted: Tuesday, June 1, 2021 3:12:52 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 22,900
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.
rainstuff
Posted: Wednesday, June 2, 2021 2:14:35 AM
Rank: Advanced Member
Groups: Member

Joined: 9/20/2016
Posts: 59
Ок, thank you!
eo_support
Posted: Tuesday, June 8, 2021 2:15:51 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 22,900
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!


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.