Check if cookie exists if not create it.
Posted
by Ozaki
on Stack Overflow
See other posts from Stack Overflow
or by Ozaki
Published on 2010-05-13T01:56:17Z
Indexed on
2010/05/13
2:04 UTC
Read the original article
Hit count: 369
TLDR: Want to check if cookie exists, if it doesn't create it.
Am using jquery1.4.2 and jquery cookie,
I know this is probably very simple but I just cant get my head right at the moment.
I want to:
- Check to see if a cookie with name of "query" exists
- If so nothing.
- If not create a cookie "query" with a value of 1.
But only if it doesn't already exist.
Thanks in advance
© Stack Overflow or respective owner