â æºå¸¯é»è©±åãWebã¢ããªã®èå¼±æ§äºæ ã¯ã©ããªã£ã¦ããã®ã WEB+DB PRESSèªã®Vol.37ã«ãæºå¸¯ãµã¤ãéçº å®è·µãã¯ãã㯠2007ãã¨ããè¨äºãæ²è¼ããã¦ããã®ã ããããã«ãããªè¨è¿°ããã£ãã 端æ«èªè¨¼ ç»é²ãå¿ è¦ãªãµã¤ãã®å ´åï¼å©ç¨ããéã«ã¯ãã°ã¤ã³ãå¿ è¦ã§ãï¼ID/ãã¹ã¯ã¼ããæ¯åå ¥åããã®ã§ã¯ï¼æºå¸¯ã®å ´åã§ã¯ç¹ã«é¢åã§ãï¼ ããã§æºå¸¯ãªãã§ã¯ã®èªè¨¼æ¹æ³ã¨ãã¦ï¼ç¾å¨ã®ç«¯æ«ã§ã¯åå¾ã容æã«ã§ãã端æ«èªä½ã®æ å ±ï¼ç«¯æ«IDï¼ãå©ç¨ãã¾ãï¼ ï¼ç¥ï¼ ã»ãã·ã§ã³ PCãµã¤ãã§ã»ãã·ã§ã³ã使ãå ´åã¯ï¼é常ã»ãã·ã§ã³IDãCookieã«ä¿åãã¾ããï¼æºå¸¯ãã©ã¦ã¶ã§ã¯Cookieã«ãã¼ã¿ãä¿åãããã¨ãã§ãã¾ããï¼ããã§æºå¸¯ãµã¤ãã§Cookieã使ãå ´åã¯URLã«ã»ãã·ã§ã³IDãåãè¾¼ããã¨ã«ãªãã¾ãï¼ ã»ãã·ã§ã³IDãGETã§æ¸¡ã ã»ãã·ã§ã³IDãGETã§æ¸¡ãå ´åã¯ï¼PHPã®è¨å®ãã¡
Perl CGIã使ã£ãWebã¢ããªã±ã¼ã·ã§ã³ã§ãã»ãã·ã§ã³æ å ±ã管çããã®ã«Walrus::Session::Lite[digit.que.ne.jp]ã使ããã¨ãã¦ããã®ã§ããããã¹ãç°å¢ã®Perl 5.8.1ã®ãã¨ã§ã¯æ©å«è¯ãåãã¦ããã®ã«ãPerl 5.6.1ã®å®ç¨¼åãµã¼ãã«ç§»ããã¨ããããã¼ã¿ãæ£å¸¸ã«ä¿åã§ããªããªã(ããããã°ãåå 調ã¹ããã¨æã£ã¦èª¿ã¹ã¦ãªãããããã¯ã¾ããã®ãã¡ã)ãæ¥é½CGI::Sessionã使ãæ¹åã«å¤æ´ãã¾ãããããããWalrus::Session::Liteã«ãã£ã¦ãCGI::Sessionã«ãªãæ©è½ã«ãæéåãã»ãã·ã§ã³ã®ä¸æ¬åé¤ãããã¾ããã»ãã·ã§ã³ã¨ããã®ã¯å¿ ãå®çµããã¨ã¯éããªãã®ã§ãæã ä½ãã®ã¿ã¤ãã³ã°ã§ãæé¤ããªãã¨ããã¤ãã¯ãã£ã¹ã¯ãåãå°½ããã¦ãã¾ããã¨ã«ãªããã¨ããããã§ããããªã¯ã©ã¹ãä½æãã¦ã¿ã¾ããããæé¤ããã®ã§ããã®åãã
åå¶ Tutorial - CGI::Sessionã®ããã«åºç¯å²ã«æ¸¡ã£ã¦è¨è¿°ãããããã¥ã¢ã« ç¶æ ã¡ã³ããã³ã¹ã®å¤§è¦Â¶ HTTPã¯ã¹ãã¼ãã¬ã¹ãªãããã³ã«ã§ãã®ã§ãWEBãµã¤ãã«å¯¾ããããããã® webãµã¤ãã«å¯¾ããã¯ãªãã¯ã¯webãµã¼ãã¼ã«ãã£ã¦æ°ãã訪åã¨ãã¦æ±ããã¾ãã ãµã¼ãã¼ã¯ç´åã®è¨ªåã¨ã¯ç¡é¢ä¿ã§ãããããã£ã¦å ¨ã¦ã®ãã以åã®ãªã¯ã¨ã¹ã ããã®ç¶æ ã¯å¤±ããã¾ãããã®ãã¨ã«ãã£ã¦ã·ã§ããã³ã°ã«ã¼ããã ãã°ã¤ã³èªè¨¼ã«ã¼ãã³ãã»ãã¥ãªãã£ã¼ä¸ã®å¶éãè¨ãããããªãµã¼ãã¹ãªã©ã¯ webä¸ã§ä¸å¯è½ã«ãªãã¾ãããã£ã¦äººã ã¯HTTPãæã ã絶æçãªç¶æ³ã«æãå ¥ãã ãã¨ã«å¯¾ãã¦ä½ããã®å¯¾çãåããªããã°ãªãã¾ããã§ããã æã ãæãã¹ããä¸å®æéã¦ã¼ã¶ã¼ã®ã»ãã·ã§ã³ãä¿ã¤HTTPã¯ããã¼ã ã¯ã¨ãªæååã¨è¨ã£ãæè¡ãèªçãã¾ãããã¯ããã¼åã³ã¯ã¨ãªæååã ãã§ã¯ RFC 2965, S
以ä¸ã®URLããåå¾ãã¦ä¸ããã http://digit.que.ne.jp/work/product/module/Walrus/Session/Lite/Lite_0.3.tar.gz ãã®ãã¡ã¤ã«ã¯Walrus::Session::Liteã¢ã¸ã¥ã¼ã«ã¨ãããããDigest::Perl::MD5.pmãå«ãã§ãã¾ãã å¾ã£ã¦ããã®ãã¡ã¤ã«ãå±éããã¨ãWalrusã¨Digestã¨ãããã£ã¬ã¯ããªãä½ããã¾ãã®ã§ããã®2ã¤ãã¢ã¸ã¥ã¼ã«ã®æ¤ç´¢å¯¾è±¡ã«ãªããã£ã¬ã¯ããªã«ç½®ãã ãã§ä½¿ç¨ã§ãã¾ãã ããããããã»ãã·ã§ã³ãã¼ã¿ãä¿åããããã®ãã£ã¬ã¯ããªãä½ã£ã¦ããã¦ä¸ããã 以ä¸ã§ã¯ã"./session/"ãã»ãã·ã§ã³ãã¼ã¿ä¿åç¨ã ã¨ãã¾ãã ã¹ã¯ãªããä¸ã§ã¯ãã¯ããã«Walrus::Session::Liteããã¼ããã¦ããã¾ãã ã¾ããã»ãã·ã§ã³ãã¼ã¿ã«çµã³ä»ããããã®ããã·ã¥ãä½æã
ã¯ããã« perlã§CGI::Session.pmã使ã£ã¦ã»ãã·ã§ã³ç®¡çãè¡ãï¼idã®çæã»æ¹æ¶ãã¯ããï¼ã»ãã·ã§ã³ç®¡çã«å¿ è¦ãªæ§ã ãªæ©è½ãæä¾ãã¦ããï¼é常ã«ä¾¿å©ã§ããï¼ CGI::Session.pmã¯å¿ è¦ãªãã¼ã¿ããµã¼ãã«ç½®ãï¼ããªãã¡ï¼ã»ãã·ã§ã³idãçæããå¾ï¼ãµã¼ãå ã«idã«å¯¾å¿ãããã¡ã¤ã«ï¼DBãæå®ãããã¨ãå¯è½ï¼ãçæããï¼ã»ãã·ã§ã³ã§å¿ è¦ãªãã¼ã¿ã¯ãµã¼ãã®ãã¡ã¤ã«ã«ä¿ç®¡ãï¼ããã°ã©ã éãè¡ãæ¥ããã®ã¯ã»ãã·ã§ã³idã®ã¿ã§ããï¼ CGI.pmãä¸ç·ã«ä½¿ãã¨å©ä¾¿æ§ã¯ããã«é«ããªãï¼ åä½ç°å¢ åä½ç°å¢ã¯ä»¥ä¸ã®éãã§ããï¼Windows XPä¸ã§Windowsçã®Apacheï¼cygwinçã®perlãåãã¦ããï¼ Windows XP Professional Apache 2.0.48ï¼Windowsçï¼ cygwin 1.5.7-1 perl 5.8.0 ã¤ã³ã¹ãã¼ã«
_ æ®ã容éãæ°åMãã¤ãã«ãªã£ã¦ãã PCããªããããé ããªã¼ã¨æã£ã¦ãµã¨ç©ºããã£ã¹ã¯å®¹éãã¿ãããæ®ãæ°åMãã¤ãã¾ã§æ¸ã£ã¦ãããFolder Size for Windowsã§åãã£ã¬ã¯ããªåä½ã®ãã£ã¹ã¯ä½¿ç¨éããªããã¦ã¿ãã¨ããã Thunderbirdã§imapã§ã¢ã¯ã»ã¹ãã¦ããã¢ã«ã¦ã³ãã®ãã¼ã¿ãã©ã«ãã«ããªãã1Gãã¤ããªã¼ãã¼ã®INBOXãã¡ã¤ã«ããã£ãããªã«ããï¼ãåé¤ãããã©å¥ã«åä½ã«ã¯æ¯éã¯ãªãã puttyã®logãç¡éã«è¿½è¨ããããâ¦â¦ãæ°Gãã¤ãã æãã¦ã³ãã¼ãããCD/DVD-ROMã®isoã¤ã¡ã¼ã¸ãã¡ã¤ã«ãããããããã«æ¶ãããæ®ã£ã¦ããã10Gãã¤ããªã¼ãã¼ã ãã¨ãç´°ãããã³ãã©ãªãã£ã¬ã¯ããªã®ä¸èº«ã¨ãæ¶ãããã30Gãã¤ãããã空ãããããã¾ã§ãã£ã¦ä¹ ãã¶ãã«ããã©ã°ãèµ·åãããã表示ãçã£èµ¤ï¼ã»ã¨ãã©å ¨é¨æçåããã¦ããï¼ã ã£ãã®ã§ãæé©åå®è¡ä¸ã
HTTPã使ç¨ããWebã¢ããªã±ã¼ã·ã§ã³ã«ããã¦ãå®å ¨ãªã»ãã·ã§ã³ç®¡çãè¡ããã¨ã¯é£ããåé¡ã§ãããã¿ããã©ã¦ã¶ã«ããç»é¢ã®è¤æ°èµ·åããWebãã©ã¦ã¶ã®æ»ããã¿ã³ï¼æ´æ°ãã¿ã³ã®æ¼ä¸ã¨ãã£ããäºæããªãç»é¢é·ç§»ã«èµ·å ãããã°ã®çºçã«é ãæ©ã¾ãããã¨ã¯å¤ãã ããã 大ããªåé¡ãçºçããªããªãã°ãç»é¢é·ç§»ã®ä»æ§ä¸ã®å¶éãã¯ã©ã¤ã¢ã³ãã«è¨±å®¹ãã¦ãããé¸æè¢ãããã ããããä¸æ£ãªç»é¢é·ç§»ãå©ç¨ããã»ãã¥ãªãã£ãã¼ã«ãåå¨ãããªãã°ãæ¾ç½®ãã¦ããã¦ããåé¡ã§ã¯ãªããªããä»åã¯ã»ãã·ã§ã³ç®¡çãå®å ¨ã«è¡ãããã®åºæ¬çãªæ³¨æç¹ã«ã¤ãã¦è§£èª¬ãã¦ãããã ã»ãã·ã§ã³åºå®æ»æã¨ã¯ä½ã ã»ãã·ã§ã³åºå®æ»æï¼Session Fixationï¼ã¨ããèå¼±æ§ãè³ã«ãããã¨ã¯ããã ããããèå¼±æ§ãã®ãã®ã®è©³ãã解説ã¯æ¬ç¨¿ã®è¶£æ¨ã§ã¯ãªãããå²æããããç°¡æ½ã«èª¬æããã¨ã以ä¸ã®ãããªæé ãè¸ããã¨ã«ããã»ãã·ã§ã³æ å ±ããã¤ã¸ã£
Web ã¢ããªã±ã¼ã·ã§ã³ãä½ãä¸ã§ã¯æ¬ ãããªã Cookieã æ¬ã³ã¼ãã¼ã§ã¯ Cookie ã®ä»çµã¿ã詳ãã説æããPerl ã¹ã¯ãªããã§ã®å®è£ æ¹æ³ãç°¡åã«è§£èª¬ãã¦ããã¾ãã ç®æ¬¡ Cookie ã¨ã¯ï¼ Cookie ã¨ã¯ããµã¼ãã¨ã®éä¿¡ã«ããã¦ç¹å®ã®æ å ±ãã¯ã©ã¤ã¢ã³ãï¼ãã©ã¦ã¶ã¼ï¼ã«ä¿æããããã®ã§ãã 主ã«ã¦ã¼ã¶ã¼ã»ãã·ã§ã³èå¥åãä¿åããããã«ä½¿ããããã¨ãå¤ãã§ãããã ãã®ä»çµã¿ã«ããããã°ã¤ã³ã¨ããä»çµã¿ãä½ã£ãããããªãåãã«ãã¼ã½ãã©ã¤ãºãããã³ã³ãã³ãã åºåã表示ãããªã©ï½ä»çµã¿ãå®ç¾ã§ããããã«ãªãã¾ãã Cookie ã使ããã¨ã«ãã£ã¦å¤å½©ãªæ©è½ãå®ç¾ãããã¨ãã§ãã¾ãã®ã§ã CGI ãä½æããã«ããã£ã¦ã¯é常ã«ä¾¿å©ãªæ©è½ã§ãã Cookie 㯠Netscape Communications Corporation ã PERSISTENT CLIENT STA
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}