javascript - When I get the cookie, it is null -


i want cookies have setted, when use console.log(document.cookie), value null.why? code:

document.cookie="name=hi";  document.cookie="displayname=hello";  var strcookie=document.cookie;  console.log(strcookie); //output  ''
enter image description here why? query relevant information, dont's find solution of problem.can me? thank you!


Comments

Popular posts from this blog

How to show in django cms breadcrumbs full path? -

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -