I'm using AngularJS $cookies 1.6.9 to manage cookies on my website. I've tried a simple cookie set, as follows:
$cookies.put('myCookieTest', 'test');
var cookie = $cookies.get('myCookieTest');
console.log(cookie);
I've installed angular-cookies correctly and no error is returned in the console when I set or retrieve the cookie. Though the result of this code snippet is undefined
. In the Google Chrome inspector, unde the Application tab, in the cookies section I don't see my cookie so it seems the code doesn't set it.
Any idea on what I'm missing here or what is wrong with the code?