What if the js local setting cookie is invalid? (under the chorme browser, a local service is set up with node)

1. At the beginning, the service is not started and the code on cookie is directly set with js:

var _json = {
    username: "ming"
} 
var _cookies = "";
_json["domain"] = document.domain;
_json["max-age"] = 60*60*24*90;
_json["path"] = "/";
for(var key in _json){
    _cookies += key + "=" + _json[key]+";";
}
document.cookie = _cookies;

did not set successfully

  1. searched and said that chorme must have a service to set up, so a node service was set up to access a page and set up cookie, but still did not succeed. The node service is a basic web access service
.

hoping that experienced friends can help generously, I have searched for a long time and tried all kinds of methods to solve the problem. It may be that the service mode is wrong or for other reasons, I do not have the ability to find and advise

Mar.20,2021

I just tried it on the chrome console. Can you set cookie with this js code?

clipboard.png


npm install-- save js-cookie

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea437b-47a9d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea437b-47a9d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?