creating cookies on file:/// url - evidence it is being created but not showing in document.cookie or cookie list in chrome dev tools
问题 I have some code that creates cookies. It creates two different user groups, checks for what group the users cookie is and does something based on it. The code is being developed on a local machine so it is accessed through a file:/// URL It looks like this: function cookieCreation() { var groupId = Math.floor(Math.random() * 2) + 1; var expDate = new Date(new Date().getTime()+60*60*1000*24).toGMTString() document.cookie = "userGroup_" + groupId + ";" + "expires=" + expDate +";path=/"; }