Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Sessions nightmare


Recommended Posts


After 3 days of frustration I've decided to ask about this on the forum.

So here it is :

After upgrading the distribution on my server my test shop stop working. I'm running MS2 plus some improvments that i''ve made.

I'm learning now PHP so bare with me.

The problems is that I cannot login anymore and also I cannot add anything to the shopping cart. After I looked into the code I've realised that is a session problem. My session data was lost.

Ar first I thought it was because of the upgrade. I'm not sure because since the upgrade I did not make big changes to the site to break the session code. But I've tested an older shop on the same machine and on that is working. Same PHP ,same MYSQL.

So i looked a little bit further in the code ... It seems that after a redirect in login.php all the session data is lost...


I've double check my configure.php and i've put some debug info the the sources. The cookie with the OSC session id is passed but still the session data is not available anymore after the redirect. ...


error_log('cookies  = ' . (string) implode(',',$HTTP_COOKIE_VARS) ,0);
[02-mar-2004 14:34:47] cookies  = please_accept_for_session,c1963cbed36eda7cf37c06fcfcb07a56

I don't know what to do anymore.

I think this is a common problem, I've checked the forums but none of the info there helped.

BTW, can anyone tell me how I can do some remote debugging with PHP 4.2.2 ?


Any help appreciated.




Link to comment
Share on other sites

Thats not true the problem is that there are sometimes so many posts and not enough answers, with to many of the posts being the same old questions, so that you go away and come back and there may be 10 pages of posts to go through.


Will you stop ranting and answer the question,


hey I'll try


in both of your configure.php files do you have sessions set to mysql

what is your cookie path and domain

are cookies set to force


I have ssen this happen due to cookie domain being www.yourdomain.com instead of yourdomain.com


If you post your configure.php files remember to xxx out the database password


We can start by making sure everything is correct in these files


Are you on a shared server

do you use SSL

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Thanks Steve. I'm sorry but I'm kind of stuck here ... I know this forum is full of post mostly (probably this one aswell) being old issues with known aswers. I think the problem is in the poor search system and also because a lot of people here post tons of source code in the thread instead of attaching them . Very difficult to find an answer in this case.

Back to my problem.

Here are the details: this problems hapens regardless

- if I ue SSL or not (now is disabled)

- if I use mysql session or not (now I'm not)

- if I set cookies force or not (now I'm not :-))

I'm not on a shared server.

And here is my configure.php

 define('HTTP_SERVER', 'http://thebarbu.xsoftware.ro');// eg, http://localhost - should not be empty for productive servers
 define('HTTPS_SERVER', 'https://thebarbu.xsoftware.ro'); // eg,https://localhost - should not be empty for productive servers
 define('ENABLE_SSL', false); // secure webserver for checkout procedure?
 define('HTTP_COOKIE_DOMAIN', 'thebarbu.xsoftware.ro');
 define('HTTPS_COOKIE_DOMAIN', 'thebarbu.xsoftware.ro');
 define('HTTP_COOKIE_PATH', '/catalog/');
 define('HTTPS_COOKIE_PATH', '/catalog/');
 define('DIR_WS_HTTP_CATALOG', '/catalog/');
 define('DIR_WS_HTTPS_CATALOG', '/catalog/');
 define('DIR_WS_IMAGES', 'images/');
 define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
 define('DIR_WS_INCLUDES', 'includes/');
 define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
 define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
 define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
 define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
 define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');

 define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/');
 define('DIR_FS_CATALOG', '/var/local/www/sites/thebarbu/catalog/');
 define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

// define our database connection
 define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql'




Link to comment
Share on other sites

One more thing that I've noticed and that explains it...

If I set the session handle to files (in /tmp dir) I get 0 length files there ... So no content. If I'm testing on the other shop that I've mentioned I have content in the session files in /tmp


It seems that the files are opened but it cannot write on them. Of course the permisions are ok . (both shops are running on the same server).



Link to comment
Share on other sites


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

  • Create New...