function setCookie(key, value, t) { var oDate = new Date(); oDate.setDate( oDate.getDate() + t ); document.cookie = key + '=' + value + ';expires=' + oDate.toGMTString(); } function getCookie(key) { var arr1=document.cookie.split(';'); for(var i=0;i<…