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

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
  • [Zen Cart] Can't execute Magic SEO URLs sitemaps
    I installed Magic SEO URLs Sitemaps Add-On for ZenCart MSU4.x/MSU5.x 2.0 on my server, when I try to generate sitemaps using: https://www.pechesudv155.owally.com/sitemaps.php I received :...
    by peter@pechesud.com
  • [phpBB3] Sharing users between phpBB / PrestaShop
    Hi i have 2 question 1- prestashop module support phpBB 3.3 ? 2- why we can not login in prestashop and phpbb with same user?
    by zohall
  • [phpBB3] AJAX Userinfo Extension
    Hi! I'm having trouble with this extension: https://www.phpbb.com/customise/db/exte ... _userinfo/ I tried asking support from the author but for no avail, since now. My request for support...
    by Lord Phobos
  • [phpBB3] Upgrade to phpBB 3.2.3
    Hello.. after Upgrade to phpBB 3.2.3 I am getting this message.. How can I solve this issue..? Thank you
    by ingbrzy
  • [phpBB3] URL path changed
    Hello.. I have changed my site path after moving to new hosting and now can not activate SEO module.. new path http://www.miuios.cz/domains/miuios.cz/ could you help me? thank you
    by ingbrzy2
Join our support forum » Pre-Sales Questions »
Featured Testimonials

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

Magic SEO URLs for osCommerce are amazing product, helps my site a lot with SEO. The biggest advance of Magic SEO URLs is excellent service support. I know what I'm talking about because I had already bought web software from about 10 different companies. Magic SEO URLs is the best one. Keep the quality of the product and service and...

Jacek, the owner of Agro-Modele.pl

More Testimonials »