node.js http 쿠키 (1) 썸네일형 리스트형 6-3 http 모듈에서의 쿠키데이터 설정 http 모듈에서의 쿠키 설정은 간단합니다. ( 예제는 서버단에서의 쿠키 설정입니다. 클라이언트 단에서는 javascript 로 하시면 됩니다.) server.js 소스 var http = require("http"); http.createServer(function(req, res) { res.writeHead(200, { 'Content-Type': 'text/html', 'Set-Cookie': [ 'name = uiandwe' , 'des = test' ] }); res.end(req.headers.cookie); }).listen(8080, function(){ console.log("server running"); }); 소스상에서의 name=uiandwe , des =test 를 셋팅하였습니.. 이전 1 다음