Set Cookies - specific expiry date and time format

I need to create a cookie with specific expiration date and time. Can you please give me advice what should be the correct expiry date and time format in this case ?
posted on 04.07.2019 at 18:25
0pnshow more
onefiveonefive
Hi,

To create a cookie in Javascript with specific expiry date, you have to set the exact expiration weekday, day, month, year and time. You have to match the following formatting:

document.cookie = "abc=12345; expires=Thu, 15 Aug 2019 12:00:00 GMT; path=/";

Both weekday and month have to be set in shorten format. To create this type of cookie, the whole date has to be correct. The weekday has to match the stated date.
posted on 21.07.2019 at 12:52
0pnshow more
TimTim
share on facebookshare on twitter
2019 AnswerTabsTermsContact us
This site uses cookies to improve your experience, for analytics and ads. By continuing to browse this site you agree to our use of cookies.