Asked 2 years ago
15 Apr 2022
Views 495
pratik

pratik posted

Javascript : how to store array in cookie ?

i want to store the array into cookie but not sure how to do it?
I know how to store the cookie for one variable, but dont how to store array to cookie , below code is for the single value not arrray to cookie in javascript

 var d = new Date();
    d.setTime(d.getTime() + (exdays*24*60*60*4000));
    var expires = "expires="+ d.toUTCString();
    document.cookie = "Cookiename=Cookievalue;" + expires + ";path=/";






Post Answer