0

I am trying to console.log one of my cookies called "access-token", and I need to get this specific cookie, but when I try to use document.cookie, I get lots of other unwanted cookies. Is it possible to specifically get this cookie?

I've tried document.cookie('access-token') but it returns an error.

KriZz
  • 1
  • 2
  • Please visit the [help], take the [tour] to see what and [ask]. Do some research - [search SO for answers](https://www.google.com/search?q=javascript+get+cookie+by+name+site%3Astackoverflow.com). If you get stuck, post a [mcve] of your attempt, noting input and expected output using the [\[<>\]](https://meta.stackoverflow.com/questions/358992/ive-been-told-to-create-a-runnable-example-with-stack-snippets-how-do-i-do) snippet editor. In this case the snippet would not run due to sandboxing blocking cookies and localStorage but for most other stuff it works. – mplungjan Jan 16 '23 at 07:50

0 Answers0