Javascript cookies are set with incorrect expiry date in Safari 14.0.3

Using the following javascript code to set a cookie in Safari results in an incorrect expiry date being set on the cookie.

The same code produces the correct result in Google Chrome.

Code Block
document.cookie = "cookie_name=1615209245; expires=Tue, 08 Mar 2022 13:14:05 GMT; path=/;"

This code produces a cookie with an expiry date of March 8, 2022 in Google Chrome as expected,

but incorrectly as March, 16, 2021 in Safari.

Is this a known issue?

What can I do to get the correct result?

Addendum:

The expiry date set by Safari is one week from the current time, and so advances with the date of setting the cookie.

Is there a Safari setting involved?

Is anyone able to reproduce the error?

Hi Scott, We have a similar issue with safari an cookies that we set up on client side.

you find a solution?

Javascript cookies are set with incorrect expiry date in Safari 14.0.3
 
 
Q