This is a discussion on Session data is lost within the osCommerce 2.2 Installation Help forums, part of the osCommerce 2.2 Forums category; Hello. After 3 days of frustration I've decided to ask about this on the forum. (I've posted this also on ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| Hello. After 3 days of frustration I've decided to ask about this on the forum. (I've posted this also on OSC official 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... Code: tep_redirect(tep_href_link(FILENAME_DEFAULT)); Code: error_log('cookies = ' . (string) implode(',',$HTTP_COOKIE_VARS) ,0);
....
[02-mar-2004 14:34:47] cookies = please_accept_for_session,c1963cbed36eda7cf37c06fcfcb07a56
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. Thanks Cristian |
| Sponsored Links | ||
| ||
| |
|
#2
| |||
| |||
| tep_redirect(tep_href_link(FILENAME_DEFAULT)); This code is after an if statement. If the user has content from b4 in their cart it will load the data if not it will send you to index.php. What is the error you get when you try to login?? |
|
#3
| |||
| |||
| No error. I just goes to default page with me still not logged in. The cart is empty, etc. If I try to add a product (as a guest), the shopping cart page come up empty. Like I said, the session variables are not registered ... tep_session_is_registered('customer_id') is 1 before tep_redirect() and 0 after, in index.php or shopping_cart.php Cristian |
|
#4
| |||
| |||
| Like peteyg says, are you sure this is the tep_redirect that is being used? Try commenting it out and replacing with echo (tep_href_link(FILENAME_DEFAULT)); Otherwise your configure might be set up wrong...but you say you've checked that. Have you changed the url of the site and not the cookie path in the config though? just a few things I would check, you might already have tried them..... jon |
|
#5
| |||
| |||
| I know that THAT redirect is the problem because if I've comment it out, it works. It's not redirecting me (of course) to the index.php page but I can see my shoping cart etc ... so the session data is not distroyed. I've changed only the distro on the server and the location of the OSC root dir, not the domain name. But if the domain/cookie path would be invalid how come I get the cookie in $HTTP_COOKIE_VARS in index.php after redirect ? I can post my configure.php here .... Code: 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('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
// define our database connection
...
...
...
...
...
define('USE_PCONNECT', 'false'); // use persistent connections?
define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'
Thanks for your quick replies, Cristian |
|
#6
| |||
| |||
| define('HTTP_SERVER', 'http://www.oldcarclocks.com'); // eg, http://localhost - should not be empty for productive servers define('HTTPS_SERVER', ''); // eg, https://localhost - should not be empty for productive servers define('ENABLE_SSL', false); // secure webserver for checkout procedure? define('HTTP_COOKIE_DOMAIN', 'www.oldcarclocks.com'); define('HTTPS_COOKIE_DOMAIN', ''); define('HTTP_COOKIE_PATH', '/'); define('HTTPS_COOKIE_PATH', ''); define('DIR_WS_HTTP_CATALOG', '/'); define('DIR_WS_HTTPS_CATALOG', ''); define('DIR_WS_IMAGES', 'images/'); define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/'); define('DIR_WS_CONDI', DIR_WS_IMAGES . 'condition/'); define('DIR_WS_REF', DIR_WS_IMAGES . 'ref/'); 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/'); //Added for BTS1.0 define('DIR_WS_TEMPLATES', 'templates/'); define('DIR_WS_CONTENT', DIR_WS_TEMPLATES . 'content/'); define('DIR_WS_JAVASCRIPT', DIR_WS_INCLUDES . 'javascript/'); //End BTS1.0 define('DIR_WS_DOWNLOAD_PUBLIC', 'pub/'); define('DIR_FS_CATALOG', '/var/www/html/'); define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/'); define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/'); This is my configure file...im comparing it to yours. I noticed you have SSL defined as false as do i but you still have your server defined in it. So try taking out the HTTPS definitions like i have see if this helps though im not sure if it will. |
|
#7
| |||
| |||
| Nope. It's not working. |
|
#8
| |||
| |||
| 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 sops are running on the same server). Cristian |
|
#9
| |||
| |||
| Do you want to use SSL? |
|
#10
| |||
| |||
| Not at the moment, peteyg. But I did what you suggested in your configure.php and still nothing. An the other OSC installation that is running on the same site is using SSL and it's working. Cristian |
| Sponsored Links | ||
| ||
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Data Base | Milmod | osCommerce 2.2 Modification Help | 0 | 03-01-2005 01:34 AM |
| How do I import data from previous version data base? | rondgray | osCMax v1.7 Discussion | 1 | 12-19-2004 12:24 AM |
| data question | annea03 | osCMax v1.7 Discussion | 3 | 10-10-2003 11:14 PM |
| Cannot save data | mallim | osCommerce 2.2 Installation Help | 1 | 09-16-2003 07:47 AM |
| SSL Errors, Session Cookie, Session Cache, NOVICE Problems? | hanool | osCommerce 2.2 Modification Help | 1 | 09-07-2003 12:49 PM |