osCommerce, osCommerce Design, osCommerce Hosting, osCommerce modules, osCommerce developers

Holbi

Testimonials

"I contacted Holbi a few months ago as I was having some problems with a web-store I had purchased through a Norwegian IT firm. Holbi offered me help right away at a very reasonable price and I found the service to be truly excellent.

As I got absolutely no help from the Norwegian firm who had charged me a great deal of money for a store that was not functioning very well, I decided to move everything to Holbi and ordered a complete new store through the very safe Trueloaded system!"

read more 

Anette Thorud, hotandtrendy.no

"We wanted to upgrade our webstore radically with new outlook and features. We couldn't find anyone domestically to make this happen - seems like the task was just too difficult and time-consuming to handle. Then we decided to contact Holbi, and couldn't be happier working with them. We got all the features we wanted, and even more. Their communication is of high level, they are very flexible and happy to make all our wishes to come true. On top of all, the whole project is impressively fast and cost-effective. Highly recommended to anyone looking for a e-commerce solution!"

read more 

Kristian Porthan, soundstore.fi

Problem of osCommerce session IDs in the links

A customer brought a problem to our attention today. They sent a newsletter to their subscribers an accidentally included an URL to one of the pages of their web site that contained osCommerce session ID.

This resulted into several of the subscribers seeing shopping cart of each other. An immediate solution was to block that specific session ID.

But lets see what happens in case a search engine spiders a link to some page of an osCommerce web site that contains session ID, or if such link gets included into a newsletter, again with session ID.

Each time a new visitor comes to the web site - osCommerce creates a new session, and then uses that session to store various variables, including customer’s login information if the customer chooses to log in. Shopping cart is also stored in the session. Sessions themselves can be stored in the database or in one of the folders (usually /tmp) on the server. In either case, session IDs being unique guarantee each customer works with that customer’s specific session and session variables.

What happens when osCommerce script finds a session ID attached to the link? What happens if a customer opens such link in the browser, and the link already has session ID? By default - osCommerce will try to locate a session with the same ID in its “session pool”. And if it succeeds - the customer gets access to the information stored in the session. If it can not find such session in the “session pool” - osCommerce will create a new session, but with the same ID as was specified in the URL.

So if a link with a session ID gets included into a newsletter, or is spidered by a search engine - two customers clicking that link in the same or almost in the same time (the difference depends on the server configuration, up to about 15 minutes by default) could actually share the same session, get access to the same user account, or share the same shopping cart contents.

That is why links should be only included into newsletter without session IDs, and sessions should not be started at all if its a search engine browsing the online store.

7 Responses to “Problem of osCommerce session IDs in the links”

  1. John Harbaugh Says:

    So how do I avoid this problem?

    It is happening to me and I am not publishing a newsletter.

  2. Vadym Gurevych Says:

    If your links got spidered with osCommerce session IDs, you may want to change the name of osCommerce session variable so that old session IDs would not count.

    Please describe your problem in more details so that we could try to propose a more precise solution.

  3. Jerry Catt Says:

    I just went through this at some length. The description of the problem is very real and effects many web sites (I tested one or two out to prove it wasn’t just my site). The problem is nothing to do with newsletters or spiders though. Most of our problems were caused by our sites popularily, our customers are networking and posting links on blogs and forums, many including session IDs.

    The answer is to not ever have a session id as part of the URL visible to the customer. It appears (and I hope I am right about this) that the solution is to turn on “cookies” for the session IDs which turns off the session ID in the URL. This seems to be working OK.

    Note that you also have to rename the session id variable, because all existing links will otherwise select the same session (as described in an earlier post).

    All in all this is a real pain and I am surprised that the osCommerce team are not on top of it.

    I also tried to avoid the problem by using the options to validate the IP address and browser. DO NOT DO THIS. The result is that whenever someone tries to follow the link they instead end up at your log-in page when the session gets invalidated. This will happen every time anyone visits the site via a link with a session ID, and you will see a huge number of exit pages as login.php (been there done that!)

    If someone on the osCommerce team has any better suggestions please comment!

  4. Boris Says:

    The main problem of osCommerce is some junk companies.
    Keep away from Moneybookers, it’s the worst Internet company I have ever seen: you can’t withdraw your money and nobody wants to help you for months!!!

  5. Kym Says:

    Forcing cookies does not work with authorize.net and for a lot of people who block cookies.

    Setting the standard sessions flag to recreate the session after login prevents people who are using a common session ID via a link from actually sharing carts/account throughout checkout. (Although I am not 100% convinced there are not other issues associates with using that setting). This does not work with the Purchase without Account contribution of course.

  6. Paul Says:

    Okay, Has anyone ever heard of POST variables? When I saw the osCID was being passed as a GET (query string) I was appalled. What else is insecure about this system? From a coding standpoint the backend is spaghetti and I am sure I will break it trying to find all of the GET requests and replacing them with POST and or forms. I understand that I get what I pay for when I use something free, but this is not an oversight. It is a beginner mistake. Does anyone know if there is a version of this software that has been modified to obscure variables relating to customer accounts?

  7. Bobby Says:

    Is there a way to simply disable session ID’s long enough to run a sitemap crawl?

Leave a Reply