Skip to content

Instantly share code, notes, and snippets.

@joubin
Last active September 13, 2016 06:30
Show Gist options
  • Save joubin/99a8869e0d209b0f091ddbb3cdcded9a to your computer and use it in GitHub Desktop.
Save joubin/99a8869e0d209b0f091ddbb3cdcded9a to your computer and use it in GitHub Desktop.
var cookieValue = readCookie("sessionID");
console.log(cookieValue);
if (cookieValue === undefined){
document.write("First visit!<br>Will write session id to cookie now")
document.cookie = "sessionID=1000";
}else{
document.write("Session id: " + cookieValue);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment