Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript get cookie

function getCookie(name) {
  const value = `; ${document.cookie}`;
  const parts = value.split(`; ${name}=`);
  if (parts.length === 2) return parts.pop().split(';').shift();
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #cookie
ADD COMMENT
Topic
Name
4+2 =