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	=	'')	=>
   168   169   170   171   172   173   174   175   176   177   178