in JavaScript by
How can you create a cookie with the help of JavaScript?

1 Answer

0 votes

You can create a cookie in JavaScript simply by assigning a string value to the document.cookie object. 

The syntax:

document.cookie = “key1 = value1; key2 = value2; expires = date”;

Related questions

0 votes
asked Oct 19, 2019 in JavaScript by SakshiSharma
0 votes
asked Jun 6, 2020 in PHP by SakshiSharma