Currently, I am developing an angular application that requires session tracking. To achieve this, I am utilizing the $cookies service in angular 1.4+. In my specific case, I am using version 1.4.9 for this project.
The issue arises when I log in as a user and set my cookies upon successful login with the following code:
var cookieArray = {session_id: sessID, token_access: accessToken};
$cookies.put('my_session', cookieArray, {expires: new Date(2016,6, 30)});
Upon checking my cookies in Chrome after logging in, I can see that the cookie has been properly created with expiration date set to July 30th, 2016. However, every time I refresh the page, this particular cookie is deleted. Although I have set the expires property, it doesn't seem to solve the issue. I have thoroughly reviewed the app's codebase but could not find any other instances where cookies are being tampered with, which leaves me puzzled.