I am using angular 1.2.32 in an old project and I need to know how can I set the expiry of cookie. I am using ngCookies for it and trying to set cookie using below line:
$cookies.putObject("newotpcookieobject", '7668787', { 'expires': expiresValue });
here the expiresValue is datetime object in javascript, code for getting it is below:
var today = new Date();
var expiresValue = new Date(today);
expiresValue.setMinutes(today.getMinutes() + 120);
I am new to angularJS framework.