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
  • [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
  • [phpBB3] Chinese language support
    Hi, i bought magic seo for phpbb because it says that it supports a wide range of alphabets and UTF-8, however i found that it doesn't. I'm preparing a website in Chinese and all forums having a...
    by iwsmike
  • [WP2PS] Yoast SEO plugin
    Thanks for your support installing the PS-WP integration. However there is some errors when PS-WP integration is activated. 1. Error generating sitemap with Yoas SEO plugin (it disappears when...
    by argidomin
  • [Zen Cart] How to exclude words from URLs
    I'd like to know if it's possible to configure some stop words (in italian language) to remove from SEO URL. Thanks
    by incircolo
  • [PrestaShop] Setting-up CDN
    Hi, the url that generates is this: Code: <link href="//static1.peplogar.com/modules/psaccelerator/cache/961263a2bac53db414c080690bc69cfd.css" rel="stylesheet"...
    by PepLogar
Join our support forum » Pre-Sales Questions »
Featured Testimonials

I normally don't give product testimonials, but your product works so well that I just can't keep quiet about it. I am a web designer and SEO, over the years I've worked with my different shopping carts and one of their biggest weaknesses is bad SEO of the cart link structure, in particular duplicate content issues through out most carts....

Kinnaert, the owner of Arnolds Office Furniture

We are glad with our business relationship with the folks at Inveostore.com. They are very knowledgeable and speed of support is second to none. They have also gone the extra mile to assist us in writing codes to make other urls to have the nicely formed urls. Kudos to all the team at Inveo and keep up the good work. Looking forward...

Issac, the owner of Clevershoppers.com

More Testimonials »