document.cookie = "cookie_name=cookie_value;path=/";
When we set a cookie in javascript using document.cookie, it set the cookie for that specific page on which we are running the script. To set the cookie for the entire site we use path keyword with cookie name and cookie value and assign it '/' value.
0 Comments