{"id":1089,"date":"2013-09-13T12:48:40","date_gmt":"2013-09-13T12:48:40","guid":{"rendered":"http:\/\/www.attob.com\/blog\/?p=1089"},"modified":"2013-09-13T12:48:40","modified_gmt":"2013-09-13T12:48:40","slug":"php-cookie%e3%81%8c%e3%82%aa%e3%83%95%e3%81%ae%e5%a0%b4%e5%90%88%e3%81%ae%e5%af%be%e5%87%a6%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.attob.com\/blog2\/2013\/09\/13\/php-cookie%e3%81%8c%e3%82%aa%e3%83%95%e3%81%ae%e5%a0%b4%e5%90%88%e3%81%ae%e5%af%be%e5%87%a6%e6%96%b9%e6%b3%95\/","title":{"rendered":"PHP Cookie\u304c\u30aa\u30d5\u306e\u5834\u5408\u306e\u5bfe\u51e6\u65b9\u6cd5"},"content":{"rendered":"<p>&lt;?php<br \/>\nsession_cache_expire(60); \/\/ 30 is 30min<br \/>\nsession_start();<br \/>\n$a = isset($_GET[&#8216;a&#8217;]) &amp;&amp; strlen($_GET[&#8216;a&#8217;]) &gt; 0 ? $_GET[&#8216;a&#8217;] : &#8221;;<br \/>\n$welcome_page_session = isset($_SESSION[&#8216;welcome_page_session&#8217;]) &amp;&amp; $_SESSION[&#8216;welcome_page_session&#8217;] == &#8216;true&#8217; ? &#8216;true&#8217; : &#8216;false&#8217;;<br \/>\n\/\/$welcome_page_session = isset($_SESSION[&#8216;2&#8217;]) &amp;&amp; $_SESSION[&#8216;w&#8217;] == &#8216;true&#8217; ? &#8216;true&#8217; : &#8216;false&#8217;;<br \/>\nif($a == &#8216;welcome&#8217;):<br \/>\n$_SESSION[&#8216;welcome_page_session&#8217;] = &#8216;true&#8217;;<br \/>\nheader(&#8220;Location:\/test.php?a=w&#8221;);<br \/>\nexit();<br \/>\nendif;<br \/>\nif($a == &#8216;w&#8217; &amp;&amp; $welcome_page_session == &#8216;true&#8217;):<br \/>\necho &#8216;available session&#8217;;<br \/>\nelse:<br \/>\n\/\/echo $_SESSION[&#8216;t&#8217;];<br \/>\necho &#8216;not available session&#8217;;<br \/>\nendif;<br \/>\n?&gt;<br \/>\n&lt;div&gt;&lt;a href=&#8221;\/test.php?a=welcome&#8221;&gt;welcome&lt;\/a&gt;&lt;\/div&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt;?php session_cache_expire(60); \/\/ 30 is 30min session_start(); $a = isset($_GET[&#8216;a&#8217;]) &amp;&#038;am [&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-1089","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.attob.com\/blog2\/wp-json\/wp\/v2\/posts\/1089","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=1089"}],"version-history":[{"count":0,"href":"https:\/\/www.attob.com\/blog2\/wp-json\/wp\/v2\/posts\/1089\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.attob.com\/blog2\/wp-json\/wp\/v2\/media?parent=1089"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.attob.com\/blog2\/wp-json\/wp\/v2\/categories?post=1089"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.attob.com\/blog2\/wp-json\/wp\/v2\/tags?post=1089"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}