Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sessions in v234?


Recommended Posts

Hi, I raised this query in the SEO URL thread because I thought it may be related to the add-on. On reflection (if it exists) I think it may be related to 'Sessions' (apologies for the length, I'll give the my perceived answer before the question) .

 

In v234bs (v234?) there is a piece of code in includes/functions/sessions.php in the tep_session_start() function line 64ish  -

 

     if ( isset($HTTP_GET_VARS[tep_session_name()]) ) {

      if ( (SESSION_FORCE_COOKIE_USE == 'True') || (preg_match('/^[a-zA-Z0-9,-]+$/', $HTTP_GET_VARS[tep_session_name()]) == false) ) {

        unset($HTTP_GET_VARS[tep_session_name()]);

        $sane_session_id = false;

      }

    }

 

it is repeated for $HTTP_POST_VARS[tep_session_name()] and slightly different for $HTTP_COOKIE_VARS[tep_session_name()].

 

The "(SESSION_FORCE_COOKIE_USE == 'True') ||" in the code was not present in previous versions of the script, by removing it my problem no longer occurs (it is not present in the $HTTP_COOKIE_VARS[tep_session_name()] test).

 

The problem as raised in the SEO URL thread (verbatum) -

 

I seem to have a minor problem with SEO URLs/session.php compatibility in v234bs? I’ll try to explain what I believe the problem is -

 

v234bs SEO URLs with ‘Force Cookie Use’ = true:

 

    Clear all cookies/browsing data

    Go to site

    Enter a Search Key and Search

    Enter a Search Key (same or different to first) and Search

 

 

Result:

 

    instead on being in advanced_search_result.php, index.php is loaded. Additionally an error is thrown from includes/classes/seo.class.php “undefined constant CHARSET - assumed 'CHARSET' On line 1824”.

 

 

Log entries (note the inclusion of osCsid?):

 

    “GET /advanced_search_result.php?keywords=creed&osCsid=b5lpc34dn9fchcgp043q188qr3 HTTP/1.1" 302 421 "http --/advanced_search_result.php?keywords=creed

 

    “GET /index.php HTTP/1.1" 200 5956 “http --/advanced_search_result.php?keywords=creed"

 

 

 

The problem also seems to occur with:

 

    Clear all cookies/browsing data

    Go to site

    Go to Product Listing (i.e. category list)

    Select Manufacturer from Product Listing filter

 

 

The problem only seems to happen once, everything appears OK subsequently.

 

 

Problem doesn’t seem to happen:

 

    with ‘Force Cookie Use’ = false

    using a v233 “sessions.php”

    on a clean v234bs with no SEO URLs

 

 

 

Many Thanks

Link to comment
Share on other sites

  • 2 years later...

Turn off the rewriter and if the problem goes away, the problem is in that addon. If you are using SEO 5, as opposed to Ultimate SEO, turning it off may not be enough since it doesn't really turn completely off. You may need to uninstall it from the files to find where the problem is at. The bottom line is that the oscommerce code, with or without a url rewriter, works fine for many shops so you need to try to isolate why it is failing for yours. I can say that since you say your version is the BS version but that you show code with HTTP_POST_VARS, it means you are not using the latest version of that shop since all HTTP_POST_VARS were changed to _POST (the other globals also). So that may be part of the problem.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...