JavaScript code
$cookies.put('test', 'test_value');
console.log('cookie value: ' + $cookies.get('test'));
I directly doubled click the html file to visit it by file:///C:/Users/xxxxx/test.html but I found it cannot write or read the cookie:
cookie value: undefined
If I put the html file into the 'HTML' folder of Nginx and visit it by http://127.0.0.1/test.html, I can read the cookie normally:
cookie value: test_value
I don't know why and want to know a explanation. Thx.