Js cookie value undefined

I am trying to get the string "value" from the cookie name, however, "undefined" is always printed. I use chrome and any help would be appreciated

Here is my code:

Cookies.set('name', 'value');
var plswork = Cookies.get('name');
document.write(plswork);
0
source share
1 answer
  • Cookies are stored in the JavaScript document.cookie object

    var a = document.cookie; document.write ();

-1
source

Source: https://habr.com/ru/post/1671027/


All Articles