javascriptcookies

How to get all cookies starting with a word using JavaScript?


How can I get an array containing names of all cookies starting with word?


Solution

  • document.cookie.split('; ')
        .filter(c => c.startsWith('word'));