Magic SEO URL for osCommerce (osCMax) | New 2.0 Series!

Session Save path Fix

If you are using MySQL based sessions on your osCommerce installation and your web server has Safe Mode On, you receive following message:

Warning: session_save_path() [function.session-save-path]: SAFE MODE Restriction in effect. The script whose uid is X is not allowed to access owned by uid Y in /path/to/your/oscommerce/catalog/includes/functions/sessions.php on line 149

We recommend this MOD when your web server has Safe Mode Off too.

MOD Title: osCommerce 2.2ms2-060817 Session Save Path Fix for MySQL based Sessions
MOD Author: Inveo s.r.o.
MOD Description: Remove unwanted warning message.


INSTALLATION INSTRUCTIONS

OPEN:

catalog/includes/functions/sessions.php

FIND:

  function tep_session_save_path($path '') {
    if (!empty(
$path)) {
      return 
session_save_path($path);
    } else {
      return 
session_save_path();
    }
  } 


REPLACE WITH:

  function tep_session_save_path($path '') {
  if (
STORE_SESSIONS != 'mysql') {
    if (!empty(
$path)) {
      return 
session_save_path($path);
    } else {
      return 
session_save_path();
    }
  }
  } 


OPEN:

catalog/admin/includes/functions/sessions.php

FIND:

  function tep_session_save_path($path '') {
    if (
$path != '') {
      return 
session_save_path($path);
    } else {
      return 
session_save_path();
    }
  } 


REPLACE WITH:

  function tep_session_save_path($path '') {
  if (
STORE_SESSIONS != 'mysql') {
    if (!empty(
$path)) {
      return 
session_save_path($path);
    } else {
      return 
session_save_path();
    }
  }
  } 

SAVE/CLOSE ALL FILES