Not all cookies are same Cookie that are set by the server. Cannot be manipulated on the client side. Interesting Read Setting up Cookie Expiration Timer in JavaScript. StackOverflow Answer Sometimes you need to detect a page refresh StackOverflow Answer