DoCoMo iã¢ã¼ããã©ã¦ã¶2.0ã§Cookie
DoCoMoã®ãã®å¤ã¢ãã«ãããiã¢ã¼ããã©ã¦ã¶2.0ã¨ããããé«æ©è½ãªiã¢ã¼ããã©ã¦ã¶ãæè¼ãããããã«ãªãã¾ããã
CookieãCSS,JSãªã©ã大ããªéããããã¾ãã®ã§ãå®éã«å®æ©ã§ç¢ºèªããã¦ã¿ã¾ãã
端æ«ã¯ãN-06A ã使ç¨ãã¾ãããªãããçºå£²åæ¢ãªãã¦ãªã£ã¦ã¾ãããã
Cookie
ã¾ãã¯ãCookieã«ã¤ãã¦ã
以åã以ä¸ã®ãããªèª¿æ»ããããã¨ããã£ãã®ã§ãåã調æ»ããã¦ã¿ã¾ããã
auのSSLでのCookieの挙動がおかしい - maru.cc@はてな
au,SoftBankでSSLでCookieセッションを使用する場合の問題点 - maru.cc@はてな
çµæã¯ãåé¡ãªã使ãã¾ããhttp<->httpsã§ã®åä½ãsecureå±æ§ã®æåãåé¡ããã¾ããã
ããã使ãã°ãCookieã»ãã·ã§ã³ã§ã»ãã¥ã¢ãªãµã¤ããã¡ããã¨ä½ãããã§ãã
setcookie()ã® httponly ã®æåãåãã¦ããªãï¼
phpã®setcookieé¢æ°ã«ã¯ãhttponly ã¨ããå¼æ°ãããã¾ãã
httponly
TRUE ãè¨å®ããã¨ãHTTP ãéãã¦ã®ã¿ã¯ããã¼ã«ã¢ã¯ã»ã¹ã§ããããã«ãªãã¾ãã ã¤ã¾ããJavaScript ã®ãããªã¹ã¯ãªããè¨èªããã¯ã¢ã¯ã»ã¹ã§ããªããªãã¨ãããã¨ã§ãã ãã®è¨å®ã使ç¨ããã¨ãXSS æ»æã«ãã£ã¦ ID ãçã¾ããå±éºæ§ãæ¸ããã¾ã (ãããã¹ã¦ã®ãã©ã¦ã¶ããã®è¨å®ããµãã¼ããã¦ããã¨ããããã§ã¯ããã¾ãã)ã PHP 5.2.0 ã§è¿½å ããã¾ããã TRUE ããã㯠FALSE ã§æå®ãã¾ãã
http://jp2.php.net/manual/ja/function.setcookie.php
以ä¸ã®ãããªãã¹ãã³ã¼ãã§ãã¹ããã¦ã¿ãã¨ãããhttponlyã®æå®ãæ£å¸¸ã«åãã¦ããªãããã«æãã¾ãã
åã«ãµãã¼ããã¦ãªãã¨ããã ããªã®ããããã¾ããã
httpå´ãã¡ã¤ã«
<html> <head> <meta http-equiv="Pragma" content="no-cache"> </head> <body> <pre> <?php print_r($_COOKIE); $value = "test:".date('H:i:s').' '.$_SERVER['SERVER_PORT']; $timeout = time() + 20; setcookie("test",$value,$timeout); setcookie("test".$_SERVER['SERVER_PORT'],$value,$timeout,'/','example.com',false,true); ?> </pre> <hr> <script type="text/javascript"> document.write(document.cookie); </script> <hr> <a href="http://example.com/cookie.php?nocache=<?php echo md5(microtime()) ?>">http</a><br> <a href="https://example.com/cookie.php?nocache=<?php echo md5(microtime()) ?>">https</a><br> </body> </html>
<html> <head> <meta http-equiv="Pragma" content="no-cache"> </head> <body> <pre> <?php print_r($_COOKIE); $value = "test:".date('H:i:s').' '.$_SERVER['SERVER_PORT']; $timeout = time() + 20; setcookie("test",$value,$timeout); setcookie("test".$_SERVER['SERVER_PORT'],$value,$timeout,'/','example.com',true); ?> </pre> <hr> <script type="text/javascript"> document.write(document.cookie); </script> <hr> <a href="http://example.com/cookie.php?nocache=<?php echo md5(microtime()) ?>">http</a><br> <a href="https://example.com/cookie.php?nocache=<?php echo md5(microtime()) ?>">https</a><br> </body> </html>
çµæã¯æ¬¡ã®ããã«ãªãã¾ããã
http
https
ã¡ãªã¿ã« IE7ã®å ´åã¯ä»¥ä¸ã®ããã«ãªãã¾ãã
http
https
è¤æ°ã¦ã£ã³ãã¦
iã¢ã¼ããã©ã¦ã¶2.0ã§ã¯ãaã¿ã°ã« targetãæå®ã§ãã¾ãã
ã¿ãéã§Cookieãå
±æããããã¯ãå½ç¶å
±æãããããã§ãã
ãã©ã¦ã¶ãéãã¦ããã® Cookieã®ä¿æ
ä¸è¨ã®ãã¹ãä¸ã«ãiã¢ã¼ããã©ã¦ã¶ãéãã¦ããã¢ã¯ã»ã¹ãããã¨ãããåé¡ãªãååã® Cookieãåå¾ã§ãã¾ããã
Kimuraさんのblogã«æ¸ããã¦ãã¦æ°ã«ãªã£ãã®ã§ä»¥ä¸ã調ã¹ã¦ã¿ã¾ããã
expireã« 0ãæå®ããã¨ãããiã¢ã¼ããã©ã¦ã¶ãçµäºå¾ãå度ç«ã¡ä¸ããã¨ãã«ãCookieãåå¾ã§ãã¾ããã§ããã®ã§ããã©ã¦ã¶ãéããã¾ã§ã¨ããæåã¯æ£ããåãã¦ããããã§ãã
éã«è¤æ°ã¿ããï¼ã¦ã£ã³ãã¦ï¼ãéããç¶æ
ã§ã¯ãã©ããä¸ã¤ãéããã ãã§ã¯ãCookieã¯ä¿æããã¦ãã¾ãããããã¯å½ç¶ã®æåããªã
ã¨ãããã
DoCoMoã®æ°ãã端æ«onlyã§ããã°ãã¡ãã㨠Cookieã»ãã·ã§ã³ã§OKããã§ãã
ãã¨ã¯ãæ§ä¸ä»£ã¨ã®å·®ãã©ãåãããã§ãããã
JSå¨ãã調ã¹ã¦ã¿ããã¨æãã¾ãã
追è¨(2009-05-28)
ã©ãããã½ããã¦ã§ã¢ã¢ãããã¼ãã§JavaScriptãåããªããªã£ã¦ãã¾ã£ãããã§ãä¸è¨ã®ç»é¢ãã£ããã£ã®ãããªçµæã«ãªããªããªã£ã¦ãã¾ãã¾ããã
JavaScriptã®é¨åãåãã¾ããã