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 ?
0
give a positive ratinggive a negative rating
04 Jul 2019 at 06:25 PM
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.
0
give a positive ratinggive a negative rating
21 Jul 2019 at 12:52 PM
Tim
Share on FacebookShare on TwitterShare on LinkedInSend email
x
x
2024 AnswerTabsTermsContact us