I recently implemented AngularJS $cookies 1.6.9 in my website to handle cookie management. To test it out, I attempted a basic cookie set like this:
$cookies.put('myCookieTest', 'test');
var cookie = $cookies.get('myCookieTest');
console.log(cookie);
After ensuring that angular-cookies was properly installed and no errors were showing in the console, I was puzzled when the code snippet returned undefined
. Checking the Application tab in Google Chrome's inspector, I couldn't find my cookie in the cookies section, indicating that the code wasn't setting it at all.
Does anyone have any insights on what might be missing or incorrect with the code here?