Skip to content

Set cookies for multiple pages in JavaScript

Advertisements

To set cookies for multiple pages, you need to set the path as /.

path=/

Example

Advertisements
 document.cookie = "name=" + cookievalue + "; path=/";
See also  Insert a node at a specific position in a linked list - Hackerrank Challenge - Java Solution

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.