Here is what I’m looking to do (pseudo-code):
Imagine the name of the cookie in the example is “visited” and it contains nothing.
if visited exists
then alert("hello again");
else
create visited - should expire in 10 days;
alert("This is your first time!")
How can I achieve this in JavaScript?
You need to read and write
document.cookie