{"id":1266,"date":"2015-02-19T16:33:20","date_gmt":"2015-02-19T16:33:20","guid":{"rendered":"http:\/\/www.attob.com\/blog\/?p=1266"},"modified":"2015-02-19T16:33:20","modified_gmt":"2015-02-19T16:33:20","slug":"cookie-check-%e3%82%b5%e3%83%b3%e3%83%97%e3%83%ab","status":"publish","type":"post","link":"https:\/\/www.attob.com\/blog2\/2015\/02\/19\/cookie-check-%e3%82%b5%e3%83%b3%e3%83%97%e3%83%ab\/","title":{"rendered":"cookie check \u30b5\u30f3\u30d7\u30eb"},"content":{"rendered":"<p>define(&#8220;HTTPS&#8221;, false);<br \/>\nfunction isssn() {<br \/>\n$isssn = false;<br \/>\n$ssn = isset($_GET[&#8216;ssn&#8217;]) ? htmlspecialchars(trim($_GET[&#8216;ssn&#8217;])) : &#8221;;<br \/>\nif(isset($_SERVER[&#8216;HTTP_REFERER&#8217;]) &amp;&amp; strstr($_SERVER[&#8216;HTTP_REFERER&#8217;], $_SERVER[&#8216;SERVER_NAME&#8217;]) &amp;&amp; strstr($_SERVER[&#8216;HTTP_REFERER&#8217;], $_SERVER[&#8216;REQUEST_URI&#8217;])):<br \/>\nsetcookie(&#8216;dummy_ssn&#8217;, time(), time() + 3600, &#8216;\/&#8217;, $_SERVER[&#8216;HTTP_HOST&#8217;], HTTPS);<br \/>\n$dummy_ssn = isset($_COOKIE[&#8216;dummy_ssn&#8217;]) ? $_COOKIE[&#8216;dummy_ssn&#8217;] : false;<br \/>\nif($dummy_ssn &gt; time() &#8211; 3600):<br \/>\n$isssn = $dummy_ssn;<br \/>\nendif;<br \/>\nelse:<br \/>\nif($ssn == &#8216;check&#8217;):<br \/>\nsetcookie(&#8216;dummy_ssn&#8217;, time(), time() + 3600, &#8216;\/&#8217;, $_SERVER[&#8216;HTTP_HOST&#8217;], HTTPS);<br \/>\n$dummy_ssn = isset($_COOKIE[&#8216;dummy_ssn&#8217;]) ? $_COOKIE[&#8216;dummy_ssn&#8217;] : &#8221;;<br \/>\nif($dummy_ssn &gt; time() &#8211; 3600):<br \/>\n$isssn = $dummy_ssn;<br \/>\nendif;<br \/>\nelseif($ssn == &#8216;reset&#8217;):<br \/>\nsetcookie(&#8216;dummy_ssn&#8217;, time(), time() + 3600, &#8216;\/&#8217;, $_SERVER[&#8216;HTTP_HOST&#8217;], HTTPS);<br \/>\nheader(&#8216;Location:http&#8217; . (HTTPS == true ? &#8216;s&#8217; : &#8221;) . &#8216;:\/\/&#8217; . $_SERVER[&#8216;SERVER_NAME&#8217;] . $_SERVER[&#8216;SCRIPT_NAME&#8217;] . &#8216;?ssn=check&#8217;);<br \/>\nexit();<br \/>\nelse:<br \/>\nsetcookie(&#8216;dummy_ssn&#8217;, &#8221;, time() &#8211; 3600, &#8216;\/&#8217;, $_SERVER[&#8216;HTTP_HOST&#8217;], HTTPS);<br \/>\nheader(&#8216;Location:http&#8217; . (HTTPS == true ? &#8216;s&#8217; : &#8221;) . &#8216;:\/\/&#8217; . $_SERVER[&#8216;SERVER_NAME&#8217;] . $_SERVER[&#8216;SCRIPT_NAME&#8217;] . &#8216;?ssn=reset&#8217;);<br \/>\nexit();<br \/>\nendif;<br \/>\nendif;<br \/>\nreturn $isssn;<br \/>\n}<br \/>\n$isssn = isssn();<\/p>\n","protected":false},"excerpt":{"rendered":"<p>define(&#8220;HTTPS&#8221;, false); function isssn() { $isssn = false; $ssn = isset($_GET[&#8216;ssn&#8217;])  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-1266","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.attob.com\/blog2\/wp-json\/wp\/v2\/posts\/1266","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.attob.com\/blog2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.attob.com\/blog2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.attob.com\/blog2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.attob.com\/blog2\/wp-json\/wp\/v2\/comments?post=1266"}],"version-history":[{"count":0,"href":"https:\/\/www.attob.com\/blog2\/wp-json\/wp\/v2\/posts\/1266\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.attob.com\/blog2\/wp-json\/wp\/v2\/media?parent=1266"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.attob.com\/blog2\/wp-json\/wp\/v2\/categories?post=1266"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.attob.com\/blog2\/wp-json\/wp\/v2\/tags?post=1266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}