I am trying to use jQuery Cookie in order to show/hide a div element.
var cExpiry = lu_ban_object.cExpiry;
jQuery('.float_close').click(function () {
jQuery('.float_notice').fadeToggle('slow');
jQuery.cookie('noticeVisibility', 'hidden', {
expires: [cExpiry], //problem is here
path: '/'
});
The expires: would be a number and it represents the cookie expiry day. that number is being stored in an array and then localized, I have assigned that localized numebr to the cExpiry variable, however it is not accepting the brackets, [] I have tried () and {} but it is not working, also +[cExpiry]+
I get the following error;
Uncaught TypeError: Object [object Array] has no method 'toUTCString'
How do I change the data type to number? according to the screenshot it is saved as string.

cExpiryvariable is not an array, is just a number ie. 5, when I call it usingalert(cExpiry);it shows 5 which means the cookie expires in 5 days