osCommerce: Session save path Fix

If you are using MySQL based sessions in your osCommerce installation and your PHP runs with Safe Mode set to On, you receive the 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 also recommend this MOD when your web server has Safe Mode Off too.

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 and close all files and it’s done!

Leave a Reply

Your email address will not be published. Required fields are marked *

Cart  
(empty)

Cart Check out  »

Prices are tax inclusive.

The VAT rate for your country (US) * is 0,0 % because it is not a member of the European Union (EU).

* Please create an account if your country does not match.

Community feed
  • [PrestaShop] Setting-up CDN
    Hi, the url that generates is this: Code: Select all <link href="//static1.peplogar.com/modules/psaccelerator/cache/961263a2bac53db414c080690bc69cfd.css"...
    by PepLogar
  • [PrestaShop] Theme Provider + jQuery
    Hello, I use your module with many websites, I have only one issue : As soon as I activate the option to put the javascript in the footer in Prestashop every jQuery widget or plugin used in the...
    by Akrolab
  • [phpBB] Issue with Activation
    Hi, I just bought the SEO Magic Url Plugin for phpbb 3.2 I am having issue with activation. I have the php 7 install in my site/server. Read me file says its 5.6 , do i need the 5.6 or it...
    by pornera
  • [phpBB] Issue with Tapatalk
    After Installation of Magic SEO URLs for phpBB v3.0/3.1/3.2 5.1 we have an issue with viewing some random threads in Tapatalk app which shows this issue My config: PHP 5.4 PhpBB 3.0.12...
    by ingbrzy
  • [PrestaShop] Theme Provider FREE 1.4
    where I can download this plugin for testing mode before I byu it? thank you. DB
    by daryl0
Join our support forum » Pre-Sales Questions »
Featured Testimonials

I am loving the speed! Hope this helps bounce rate and more sales :)

Andy, the owner of Lipgloss Clubwear

Magic SEO URLs for PrestaShop is amazing product, it help me a lot with SEO, and the customer service is very nice and patient! I will built a new website, and I will buy this module again.

Joseph, the owner of Focus Vows

More Testimonials »