Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

The dreaded "session_write_close" error and SSL


atelierbeads

Recommended Posts

Posted

This has been a tooth-gnashingly frustrating day, and I'm likely to have another just like it tomorrow. I searched for information on this until my eyeballs bled, and since I didn't find any, I'm noting it down in case it might help some other hapless schlub like myself. If anyone has any insights or suggestions, I will be eternally grateful for them. The background:

 

1) I needed seriously to refresh my OSC install. I also wanted to install a secure cert. To do that, I secured a dedicated IP address in lieu of the shared one I had been using. I then purchased and installed the cert. This was all straightforward. This is a Linux/Apache server running PHP 5.2.8 and mySQL 5.0.

 

2) I created a new, dummy database, backed up my images and buttons, and completely wiped my catalog directory. I then did a brand-new reinstall of OSC 2.2rc2a. The install looked stable and normal. I fixed the old database according to instructions and re-pointed both my configure.php's to it. Again, so far, so good.

 

3) Using some very helpful instructions found here, I edited both configure.php's to reflect the https://directories and to set ENABLE_SSL to "true." I used two platforms and three browsers to check, do some user stuff, and make sure all was working. It seemed fine--secure pages were secure and browsers reported them as such. Little did I know that the error was waiting at the bottom of the page--kind of like a black widow spider. Cue up the music from "Jaws." The error is:

 

Warning: session_write_close() [function.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/mystuph/public_html/includes/functions/sessions.php on line 157

 

4) When I finally noticed the error, I had already installed my few but important mods--latest version of STS, a shipping insurance mod, one to list products in columns, and one for SEO headers. I backed my mods out one by one--a horribly tedious process--but the error persisted.

 

5) Eliminating SSL from the configure files eliminated the error. Applying the fix suggested in the error message does not eliminate the error. And by the way, the settings to be changed are not on line 157. They are on lines 14 and 15 respectively. What is on line 157 is this:

 

return session_write_close();

 

Changing it to:

 

return @session_write_close();

 

is what finally seems to have eliminated this error in both the admin and catalog sections. Here is an opinion:

 

People encountering this error are likely to be neophytes, or perhaps non-programmers like me. Reading through the appeals for help in the posts reveals quite a gap between the people who understand this and the people who do not. The error message is not helpful at all because it takes the newbie to a line that does not at first glance have any bearing on the situation. The only place that provides a clear-cut way to do anything with session.bug_compat_42 or session.bug_compat_warn is at lines 14 and 15. Only by the grace of whoever looks after idiots did I run across someone's instructions on how to edit line 157. It might be helpful to have all this enshrined somewhere, as well in those helpful "how to set up your ssl" instructions.

 

If I get up tomorrow morning and find the error has returned, I will probably throw myself to the sharks...

 

Regards,

Anne

Archived

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

×
×
  • Create New...