Page 173 - Nodejs 교과서 개정2판
P. 173
࠺ GBWJDPO ۆ җ э ਢ ࢎ చী ࠁח ܳ ڷפ
§ Ӓܿ ࠺
࠳ۄח ࠺ ޥ )5.-ীࢲ ਬ୶ೡ ࣻ হਵݶ ࢲߡী ࠺ ࠁী ೠ ਃਸ ࠁշפ അ ઁ
ীࢲח )5.-ী ࠺ী ೠ ࠁܳ ֍যف ঋওਵ۽ ࠳ۄо ୶о۽ GBWJDPO JDPܳ ਃೠ Ѫੑפ
ਃ ف ѐܳ ా೧ ܻח ࢲߡо ઁ۽ ఃܳ बਸ ഛੋೡ ࣻ णפ ߣ૩ ਃ ਸ ࠁղӝ ীח
࠳ۄо যځೠ ః ࠁب оҊ ঋणפ ࢲߡח ؊ী mycookie=testۄח ఃܳ बਵۄ
Ҋ ࠳ۄীѱ ݺ۸ 4FU $PPLJF ೮णפ ٮۄࢲ ࠳ۄח ఃܳ बҊ ف ߣ૩ ਃ /favicon.ico
؊ী ఃо ٜয ਸ ഛੋೡ ࣻ णפ
ইөח ױࣽೠ ః݅ बਸ ࡺ Ӓ ఃо աੋܳ ध߹೧ ޅೞҊ णפ ઁীࢲ ࢎਊܳ
ध߹ೞח ߑߨਸ ঌইࠇद ف ੌਸ э ಫ؊ উী ࢤࢿפ
cookie2.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>쿠키&세션 이해하기</title>
</head>
<body>
<form action="/login">
<input id="name" name="name" placeholder="이름을 입력하세요" />
<button id="login">로그인</button>
</form>
</body>
</html>
cookie2.js
const http = require('http');
const fs = require('fs').promises;
const url = require('url');
const qs = require('querystring');
➊
const parseCookies = (cookie = '') =>