To create a cookie in javascript I use
document.cookie = "cookieName=cookieValue;expires=myDate;path=/"
To read a cookie: I read many articles in the web including w3schools, but they give complicated codes with for(;;){} method and split. I don’t need such codes. I just need a small javascript code.
If anyone can, please give me a code that will display an alert with the value of 'cookieName' cookie?
This may be the easiest way I can give you.
Call the function it returns cooke value: