我无法设置带有我的chrome扩展名的cookie名称中带有下划线的cookie。 这是我设置Cookie的相关代码
if (Number(request.expirationDate) == 0) {
chrome.cookies.set({url:request.url ,name: request.name ,value: request.value , domain: request.domain , path: request.path , secure: asBoolean(request.secure) , httpOnly: request.httpOnly});
} else {
chrome.cookies.set({url:request.url ,name: request.name ,value: request.value , domain: request.domain , path: request.path , secure: asBoolean(request.secure) , httpOnly: request.httpOnly , expirationDate: Number(request.expirationDate)});
}
修改 经过仔细检查,我发现该Cookie的值是空的。这就是我发送给chrome扩展程序的信息。
chrome.runtime.sendMessage(editorExtensionId, {"url":"https:\/\/my.test.com","name":"wordpress_user_sw_1ef0e9e7d0d89edf025ec2f501da879c","value":" ","domain":"my.test.com","path":"\/","secure":"FALSE","httpOnly":false,"expirationDate":"1552372713"});