Page 221 - Nodejs 교과서 개정2판
P. 221

req.cookies ؀न req.signedCookies ё୓ী ٜয ੓णפ׮

         DPPLJF QBSTFSо ௢ఃܳ ࢤࢿೡ ٸ ॳ੉ח Ѫ਷ ইתפ׮  ௢ఃܳ ࢤࢿ ઁѢೞӝ ਤ೧ࢲח res.cookie  res.c

         learCookie ݫࢲ٘ܳ ࢎਊ೧ঠ ೤פ׮  res.cookie(키,	값,	옵션) ഋधਵ۽ ࢎਊ೤פ׮  ২࣌਷    ੺ীࢲ

         ࢓ಝࠄ ௢ః ২࣌җ زੌ೤פ׮  domain  expires  httpOnly  maxAge  path  secure ١੉ ੓णפ׮




           res.cookie('name',	'zerocho',	{
           		expires:	new	Date(Date.now()	+	900000),
           		httpOnly:	true,
           		secure:	true,
           });
           res.clearCookie('name',	'zerocho',	{	httpOnly:	true,	secure:	true	});




         ௢ఃܳ ૑਋۰ݶ  ః৬ ч ৻ী ২࣌ب ੿ഛ൤ ੌ஖೧ঠ ௢ఃо ૑ਕ૘פ׮  ױ  expiresա maxAge ২࣌਷ ੌ஖
         ೡ ೙ਃо হणפ׮


         ২࣌ ઺ীח signedۄח ২࣌੉ ੓חؘ  ੉ܳ true۽ ࢸ੿ೞݶ ௢ః ٍী ࢲݺ੉ ࠢणפ׮  ղ ࢲߡо ௢ఃܳ ݅
         ٜ঻׮ח Ѫਸ Ѩૐೡ ࣻ ੓ਵ޲۽ ؀ࠗ࠙੄ ҃਋ ࢲݺ ২࣌ਸ ெفח Ѫ੉ જणפ׮  ࢲݺਸ ਤೠ ࠺޻ ఃח coo

         kieParser ޷ٜਝযী ੋࣻ۽ ֍਷ process.env.COOKIE_SECRET੉ ؾפ׮

          
          
               FYQSFTT TFTTJPO
         ࣁ࣌ ҙܻਊ ޷ٜਝযੑפ׮  ۽Ӓੋ ١੄ ੉ਬ۽ ࣁ࣌ਸ ҳഅೞѢա ౠ੿ ࢎਊ੗ܳ ਤೠ ؘ੉ఠܳ ੐द੸ਵ۽

         ੷੢೧ل ٸ ݒ਋ ਬਊ೤פ׮  ࣁ࣌਷ ࢎਊ੗߹۽ req.session ё୓ উী ਬ૑ؾפ׮




           app.use(session({
           		resave:	false,
           		saveUninitialized:	false,
           		secret:	process.env.COOKIE_SECRET,
           		cookie:	{
           				httpOnly:	true,
           				secure:	false,
           		},
           		name:	'session-cookie',
           }));




         FYQSFTT TFTTJPO     ߡ੹ ੉੹ীח ղࠗ੸ਵ۽ DPPLJF QBSTFSܳ ࢎਊೞҊ ੓যࢲ DPPLJF QBSTFS ޷ٜਝয

         ࠁ׮ ٍী ਤ஖೧ঠ ೮૑݅      ߡ੹ ੉റࠗఠח ࢎਊೞ૑ ঋѱ غয ࣽࢲо ࢚ҙহয઎णפ׮  Ӓېب അ੤ য
   216   217   218   219   220   221   222   223   224   225   226