{"id":1996,"date":"2022-08-30T15:21:11","date_gmt":"2022-08-30T15:21:11","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/12\/08\/sessions-problem-with-php-fpm-on-nginx-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:21:11","modified_gmt":"2022-08-30T15:21:11","slug":"sessions-problem-with-php-fpm-on-nginx-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/sessions-problem-with-php-fpm-on-nginx-collection-of-common-programming-errors\/","title":{"rendered":"Sessions Problem with PHP-FPM on Nginx-Collection of common programming errors"},"content":{"rendered":"<p>Hi everyone I got some trouble with sessions that I use on my little project:<\/p>\n<pre><code>PHP Notice:  Undefined index: user_ID in ..\/config\/sessions_class.php on line 29\n<\/code><\/pre>\n<p>(this is from the nginx error.log)<\/p>\n<p>If tried setting the save path for sessions to memcache and to \/var\/lib\/php5\/sessions. Session files actually get created in the sessions directory, so the user permissions must be correct. I&#8217;m currently saving user settings to sessions such as $_SESSION[&#8216;user_ID&#8217;] on index.php and then redirecting to anotherpage.php. If I try to retrieve $_SESSION[&#8216;user_ID&#8217;] there I get the undefined index error. session_start gets called several times, but this shouldnt be the problem I guess.<\/p>\n<p>Any suggestions where the problem might be? I can append nginx.conf or php.ini files if you wish.<\/p>\n<p><strong>EDIT:<\/strong> I got Suhosin PHP Hardening &#8211; any chance this might interfere with the global SESSION variables?<\/p>\n<p id=\"rop\"><small>Originally posted 2013-12-08 05:40:08. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>Hi everyone I got some trouble with sessions that I use on my little project: PHP Notice: Undefined index: user_ID in ..\/config\/sessions_class.php on line 29 (this is from the nginx error.log) If tried setting the save path for sessions to memcache and to \/var\/lib\/php5\/sessions. Session files actually get created in the sessions directory, so the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1996","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1996","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1996"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1996\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1996"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1996"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1996"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}