Adding checking for max expiriation date in IE driver cookie handling
Attempting to add a cookie with a very large expiration date caused the IE driver to crash because of overflows in the C++ standard library time formatting functions. This commit now avoids the crash by enforcing a maximum cookie expiration time of 2,147,483,647 (2^32 - 1) seconds from the time the cookie is attempting to be set. At the time of this writing (2019), that means an expiration of the cookie sometime over 68 years into the future (2087). If the intended expiration time is beyond that limit, the driver will now return "unable to set cookie" error. As an internal implementation detail, the driver is migrating from the "expires" attribute to the "max-age" attribute of the cookie string, as versions of IE below 9 are no longer supported. Additionally, while it would be possible to use "expires" and get a longer expiration time, (somewhere around the year 3000), the distinction between a cookie expiring after 68 years and one expiring in just under 1000 years is (or ought to be) largely meaningless in the context of a website. Fixes issue #7122.
J
Jim Evans committed
103f12ad1506863cc5f330c6fcd699e68ef4ade3
Parent: 9cbc45b