How would you create a cookie?

The simplest way of creating a cookie using JavaScript is as below:

document.cookie = "key1 = value1; key2 = value2; expires = date";

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *