{"id":308,"date":"2010-01-22T22:40:31","date_gmt":"2010-01-22T13:40:31","guid":{"rendered":"https:\/\/deskplate.net\/blog\/2010\/01\/22\/ethna-session_id-%e3%81%ae%e9%95%b7%e3%81%95%e8%a8%ad%e5%ae%9a\/"},"modified":"2010-01-22T22:40:31","modified_gmt":"2010-01-22T13:40:31","slug":"ethna-session_id-%e3%81%ae%e9%95%b7%e3%81%95%e8%a8%ad%e5%ae%9a","status":"publish","type":"post","link":"https:\/\/deskplate.net\/blog\/archives\/308","title":{"rendered":"Ethna session_id \u306e\u9577\u3055\u8a2d\u5b9a"},"content":{"rendered":"<p>lib\/Ethna\/class\/Ethna_Util.php<br \/>\nlib\\Ethna\\class\\Ethna_Util.php(554):      *  @param  int     $length \u30cf\u30c3\u30b7\u30e5\u5024\u306e\u9577\u3055(\uff5e64)<br \/>\nlib\\Ethna\\class\\Ethna_Util.php(557):     function getRandom($length = 64)<br \/>\nlib\\Ethna\\class\\Ethna_Util.php(600):         if ($length < 64) {\n\u3053\u306e\u5024\u3092\u5909\u3048\u3066\u8a2d\u5b9a\u3067\u304d\u308b\u307f\u305f\u3044\u3067\u3059\nsession.hash_bits_per_character\u3000\u3067\u306f\u3067\u304d\u306a\u304b\u3063\u305f\n\u3053\u3053\uff01\nlib\/Ethna\/class\/Ethna_Session.php\n\/**\n*  \u30bb\u30c3\u30b7\u30e7\u30f3\u3092\u958b\u59cb\u3059\u308b\n*\n*  @access public\n*  @param  int     $lifetime   \u30bb\u30c3\u30b7\u30e7\u30f3\u6709\u52b9\u671f\u9593(\u79d2\u5358\u4f4d, 0\u306a\u3089\u30bb\u30c3\u30b7\u30e7\u30f3\u30af\u30c3\u30ad\u30fc)\n*  @return bool    true:\u6b63\u5e38\u7d42\u4e86 false:\u30a8\u30e9\u30fc\n*\/\nfunction start($lifetime = 0, $anonymous = false)\n{\nif ($this->session_start) {<br \/>\n\/\/ we need this?<br \/>\n$_SESSION[&#8216;REMOTE_ADDR&#8217;] = $_SERVER[&#8216;REMOTE_ADDR&#8217;];<br \/>\n$_SESSION[&#8216;__anonymous__&#8217;] = $anonymous;<br \/>\nreturn true;<br \/>\n}<br \/>\nif (is_null($lifetime)) {<br \/>\nini_set(&#8216;session.use_cookies&#8217;, 0);<br \/>\n} else {<br \/>\nini_set(&#8216;session.use_cookies&#8217;, 1);<br \/>\n}<br \/>\nsession_set_cookie_params($lifetime);<br \/>\nsession_id(Ethna_Util::getRandom());<br \/>\nsession_start();<br \/>\n$_SESSION[&#8216;REMOTE_ADDR&#8217;] = $_SERVER[&#8216;REMOTE_ADDR&#8217;];<br \/>\n$_SESSION[&#8216;__anonymous__&#8217;] = $anonymous;<br \/>\n$this->session_start = true;<br \/>\nreturn true;<br \/>\n}<br \/>\nlib\/Ethna\/class\/Ethna_Util.php \u306egetRandom()\u30e1\u30bd\u30c3\u30c9\u3067\u30bb\u30c3\u30b7\u30e7\u30f3ID\u3092\u6307\u5b9a\u3057\u3066\u3044\u308b\u305f\u3081\u3001<br \/>\n\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u306e\u30e9\u30f3\u30c0\u30e0\u6587\u5b57\u5217\u751f\u6210\u306e\u9577\u3055\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u3067\u30bb\u30c3\u30b7\u30e7\u30f3ID\u306e\u9577\u3055\u3092\u6c7a\u3081\u3089\u308c\u308b<\/p>\n","protected":false},"excerpt":{"rendered":"<p>lib\/Ethna\/class\/Ethn<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-308","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/posts\/308","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/comments?post=308"}],"version-history":[{"count":0,"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/posts\/308\/revisions"}],"wp:attachment":[{"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/media?parent=308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/categories?post=308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/deskplate.net\/blog\/wp-json\/wp\/v2\/tags?post=308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}