function setcookie(name, value, expire) { var date = new Date(); date.setDate(date.getDate() + expire); document.cookie = name + '=' + value + '; expires=' + date.toGMTString()+ '; path=/'; }