<script language=javascript> //获得coolie 的值 function cookie(name){ var cookieArray=document.cookie.split("; "); //得到分割的cookie名值对 var cookie=new Object(); for (var i=0;i<cookieArray.length;i++){ var arr=cookieArray[i].split("=")…
node.js中如何向客户端发送COOKIE呢?有如下两个方案: 一.使用response.writeHead,代码示例: //设置过期时间为一分钟 var today = new Date(); var time = today.getTime() + 60*1000; var time2 = new Date(time); var timeObj = time2.toGMTString(); response.writeHead({ 'Set-Cookie':'myCookie="type=…