Learn how JavaScript COOKIES work!

8 Views
Published
#JavaScript #cookies #tutorial

// cookie = a small text file stored on your computer
// used to remember information about the user
// saved in name=value pairs

//console.log(navigator.cookieEnabled);
//document.cookie = "firstName=Spongebob; expires=Sun, 1 January 2030 12:00:00 UTC; path=/";
//document.cookie = "lastName=Squarepants; expires=Sun, 1 January 2030 12:00:00 UTC; path=/";
//let allCookies = document.cookie;
//console.dir(allCookies);
Category
Bro Code
Be the first to comment