我可能已经在这里找到了答案,但我不掌握这个主题,我需要在网站上帮助这个cookie:
<script>
function setCookie(cname,cvalue,exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = "expires=" + d.toGMTString();
document.cookie = cname+"="+cvalue+"; "+expires;
}
function salvarCookie() {
var url = window.location.href;
var tamanho = url.length;
var codigo = url.substring(tamanho-37, tamanho-10);
setCookie("Recuperar-Boleto", codigo, 30);
}
</script>
需要更改哪些内容才能在3天后过期?你能救我吗?