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=…
在php中设置cookie. $email="abc@163.com"; setcookie("y_email",$email,time()+3600,"/"); js中获取cookie function getCookie(c_name) { if (document.cookie.length>0) { c_start=document.cookie.indexOf(c_name + "=") if (c_start…