Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the meaning of using "days*24*60*60*1000" in cookie?

Tags:

cookies

What is the meaning of using days * 24 * 60 * 60 * 1000 in a cookie?

I've seen it quite a lot and I don't understand what it means.

I need to create a function that reads the cookie and puts the value in a text box while uploading the page.

<body onload="readCookie()">
like image 278
sigu Avatar asked Mar 29 '14 17:03

sigu


1 Answers

Basically, 1000 is used here just for converting seconds to milliseconds.

Number of seconds in a day = 24 * 60 * 60 = 86400 seconds.

1 second = 1000 milliseconds.

So after calculating the expression, the result is in milliseconds.

days * 24 * 60 * 60 * 1000 = days * 86400000 ms

like image 111
Neeraj Amoli Avatar answered Nov 07 '22 19:11

Neeraj Amoli