Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Session Write Close Error


Yrewol

Recommended Posts

Posted

I get the following error on my website:

 

Warning: session_write_close(): 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 /home/httpd/vhosts/MySite.com.com/httpdocs/includes/functions/sessions.php on line 197

 

This is what the line in refrence contains.

 

194.	 // <<< END REGISTER_GLOBALS
195.	 
196.		 if (PHP_VERSION >= '4.0.4') {
197.		   session_write_close();
198.		 } elseif (function_exists('session_close')) {
199.		   session_close();
200.		 }
201.	   }
202.	 
203.	   function tep_session_destroy() {
204.	 // >>> BEGIN REGISTER_GLOBALS
205.		 // Work-around to allow disabling of register_gloabls - unmap all defined
206.		 // session variables
207.		 if (count($_SESSION))
208.		 {
209.		   $session_keys = array_keys($_SESSION);
210.		   foreach($session_keys as $variable)
211.		   {
212.			 link_session_variable($variable, false);
213.			 unset($_SESSION[$variable]);
214.		   }
215.		 }
216.	 // <<< END REGISTER_GLOBALS

 

What do I have to change to turn off this error message?

 

Thanks,

  • 2 months later...
Posted

Until a better fix is provided to suppress the error message change session_write_close() to @session_write_close().

 

The @ symbol will suppress any errors.

  • 4 weeks later...
Posted
Until a better fix is provided to suppress the error message change session_write_close() to @session_write_close().

 

The @ symbol will suppress any errors.

 

Does doing this cause any side effects ?

Posted

Other than not seeing the error, no.

Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.

Posted

Hello,

Just an update for anyone suffering from this.

 

I believe this problem is a result of using a shared SSL from my web host. The swapping of servers causes problems with session data.

 

Have since swapped hosting to a dedicated IP and Private SSL the site works a dream. In fact I would highly recommend this approach (dedicated IP / private SSL) to anyone setting up a oscommerce site as it will save you hours of chasing your own tail.

 

I am significantly balder from trying to get a shared ssl to work!!!!

 

Hope this helps to save you hours of grief.

 

Many Thanks,

Shaun

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...