Skip to content
Advertisement

Tag: cookies

Read Facebook Application Cookie from JavaScript?

(I’m fairly certain the answer to this question is quite simply “no” but I figured I’d ask in case anybody here has found a clever solution/workaround in the past.) Using the PHP code provided as an example for simple Facebook development, one can see how it reads in the cookie to get the necessary values to place in the JavaScript

Reading cookie expiration date

Is it possible to read cookie expiration date using JavaScript? If yes, how? If not, is there a source I can look at? Answer It is not possible to get the expiration date of a cookie through Javascript; only key-value pairs are exposed through document.cookie.

How do I set/unset a cookie with jQuery?

How do I set and unset a cookie using jQuery, for example create a cookie named test and set the value to 1? Answer Update April 2019 jQuery isn’t needed for cookie reading/manipulation, so don’t use the original answer below. Go to https://github.com/js-cookie/js-cookie instead, and use the library there that doesn’t depend on jQuery. Basic examples: See the docs on

Advertisement