Currently in my application, I am utilizing AngularJS 1.3. I encountered a challenge while using $cookies
to store data where I needed to implement a 1-minute expiration time for the cookie. However, the $cookies
service in AngularJS 1.3 does not provide a built-in method to set an expiration time.
I attempted the following code snippet to address this issue:
var x = new Date();
x.setMinutes(x.getMinutes() + 1);
$cookies['showStartUpScreen'] = value + ';expires=' + x.toGMTString();