{"id":9418,"date":"2019-05-08T09:29:58","date_gmt":"2019-05-08T09:29:58","guid":{"rendered":"https:\/\/ampforwp.com\/tutorials\/?post_type=ht_kb&#038;p=9418"},"modified":"2020-09-09T06:36:58","modified_gmt":"2020-09-09T06:36:58","slug":"how-to-fix-warning-session_start-in-amp","status":"publish","type":"ht_kb","link":"https:\/\/ampforwp.com\/tutorials\/article\/how-to-fix-warning-session_start-in-amp\/","title":{"rendered":"How to fix Warning: session_start() in AMP"},"content":{"rendered":"\n<p>This issue is actually from the server-side because the session doesn\u2019t seem to have full permission.<\/p>\n\n\n\n<p><strong>Follow these instructions to fix this warning.<\/strong><\/p>\n\n\n\n<p><strong>Step 1:<\/strong> Create a new folder with the name &#8220;tmp&#8221; on your root directory with full permission. <\/p>\n\n\n\n<p><strong> Step 2:<\/strong> Copy the below code and insert before<strong> session_start()<\/strong> in <strong>redirect.php<\/strong>  which you can find under this  path<strong> &#8211;  <\/strong> <strong>(<\/strong>wp-content\\plugins\\accelerated-mobile-pages\\includes\\redirect.php ) <\/p>\n\n\n\n<p> <strong> ini_set(&#8216;session.save_path&#8217;, get_home_path() . &#8216;\/tmp&#8217;); <\/strong> <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"748\" height=\"136\" src=\"https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2020\/09\/aaaaaa.png\" alt=\"\" class=\"wp-image-17763\" srcset=\"https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2020\/09\/aaaaaa.png 748w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2020\/09\/aaaaaa-300x55.png 300w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2020\/09\/aaaaaa-50x9.png 50w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2020\/09\/aaaaaa-60x11.png 60w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2020\/09\/aaaaaa-100x18.png 100w\" sizes=\"(max-width: 748px) 100vw, 748px\" \/><\/figure>\n\n\n\n<p><strong>That\u2019s it for this tutorial!<\/strong><\/p>\n\n\n\n<p>We hope it helped you. If you have any feedback or questions, then please share them in the comments section below.<\/p>\n<div id=\"div-1\" class=\"hkb-feedback\">\n\t\t\t<strong class=\"ht-mobile-exit__title\">Ask your Questions Directly!<\/strong><br>\n\t\t\t<div class=\"hkb_widget_exit__content\" style=\"font-size: 14px;\">If you can't find the solutions in this article, then just ask us in the comments and we will answer it for you!<\/div>\n\t\t\t<a href=\"https:\/\/ampforwp.com\/support\/#contact\" id=\"button\" target=\"_blank\" rel=\"noopener noreferrer\"><button>Yes, I have a Question<\/button><\/a>\n\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>This issue is actually from the server-side because the session doesn\u2019t seem to have full permission. Follow these instructions to fix this warning. Step 1: Create a new folder with the name &#8220;tmp&#8221; on your root directory with full permission. Step 2: Copy the below code and insert before session_start()&#8230;<\/p>\n","protected":false},"author":18,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":[],"ht-kb-category":[34],"ht-kb-tag":[],"_links":{"self":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/9418"}],"collection":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/comments?post=9418"}],"version-history":[{"count":19,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/9418\/revisions"}],"predecessor-version":[{"id":17774,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/9418\/revisions\/17774"}],"wp:attachment":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/media?parent=9418"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb-category?post=9418"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb-tag?post=9418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}