标签:path 网站 value pat doc var IV .com rip
js set cookie
<script type="text/javascript"> var cookieName = ‘HelloWorld‘; var cookieValue = ‘HelloWorld‘; var myDate = new Date(); myDate.setMonth(myDate.getMonth() + 12); document.cookie = cookieName +"=" + cookieValue + ";expires=" + myDate + ";domain=.example.com;path=/"; </script>
domain 可以设置所有域名包含有.example.com的网站
path 设置为 / 时,设置的cookie不区分路径
标签:path 网站 value pat doc var IV .com rip
原文地址:https://www.cnblogs.com/ryanzheng/p/9217136.html