{"id":163,"date":"2009-08-08T12:03:03","date_gmt":"2009-08-08T06:33:03","guid":{"rendered":"http:\/\/vikku.info\/codesnippets\/?p=163"},"modified":"2009-08-08T12:04:39","modified_gmt":"2009-08-08T06:34:39","slug":"session-side-effect-sessionbug_compat_42-or-sessionbug_compat_warn","status":"publish","type":"post","link":"http:\/\/vikku.info\/codesnippets\/php\/session-side-effect-sessionbug_compat_42-or-sessionbug_compat_warn\/","title":{"rendered":"session side effect session.bug_compat_42 or session.bug_compat_warn"},"content":{"rendered":"<p>Warning: Unknown: Your script possibly relies on a session<br \/>\nside-effect which existed until PHP 4.2.3. Please be advised that<br \/>\nthe session extension does not consider global variables as a<br \/>\nsource of data, unless register_globals is enabled. You can disable<br \/>\nthis functionality and this warning by setting<br \/>\nsession.bug_compat_42 or session.bug_compat_warn to off,<br \/>\nrespectively. in Unknown on line 0<\/p>\n<p>This error likely appears when setting some thing like this $_SESSION[&#8216;something&#8217;] = NULL; or you are assigning a variables value to a session which is null. hopefully.<\/p>\n<pre lang=\"text\">\r\nwhat people say is better turn off this warning by\r\n\r\n1. \"session.bug_compat_42 = 0\" in your php.ini\r\n\r\n2. setting the following in your .htaccess file\r\n    php_flag session.bug_compat_42 0\r\n    php_flag session.bug_compat_warn 0\r\n\r\n3. Directly write the following code in your php script where you want to \r\nstop the warning. It is better if you set it in a common include file.\r\n\r\nini_set('session.bug_compat_42',0);\r\nini_set('session.bug_compat_warn',0);\r\n...\r\n<\/pre>\n<p>&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"http:\/\/vikku.info\/codesnippets\/wp-json\/wp\/v2\/posts\/163"}],"collection":[{"href":"http:\/\/vikku.info\/codesnippets\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/vikku.info\/codesnippets\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/vikku.info\/codesnippets\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/vikku.info\/codesnippets\/wp-json\/wp\/v2\/comments?post=163"}],"version-history":[{"count":3,"href":"http:\/\/vikku.info\/codesnippets\/wp-json\/wp\/v2\/posts\/163\/revisions"}],"predecessor-version":[{"id":166,"href":"http:\/\/vikku.info\/codesnippets\/wp-json\/wp\/v2\/posts\/163\/revisions\/166"}],"wp:attachment":[{"href":"http:\/\/vikku.info\/codesnippets\/wp-json\/wp\/v2\/media?parent=163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/vikku.info\/codesnippets\/wp-json\/wp\/v2\/categories?post=163"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/vikku.info\/codesnippets\/wp-json\/wp\/v2\/tags?post=163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}