osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

Session data is lost

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 ...


Go Back   osCommerce and osCMax shopping cart software forums > osCommerce 2.2 Forums > osCommerce 2.2 Installation Help

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 03-02-2004, 06:58 AM
New Member
 
Join Date: Mar 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
crisp
Default Session data is lost

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));
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. ...

Code:
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.

Thanks
Cristian
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
  #2  
Old 03-02-2004, 07:15 AM
Member
 
Join Date: Jan 2004
Location: edmonton, Alberta, Canada
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
peteyg
Default

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??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #3  
Old 03-02-2004, 07:58 AM
New Member
 
Join Date: Mar 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
crisp
Default

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #4  
Old 03-02-2004, 08:04 AM
Active Member
 
Join Date: Jan 2003
Location: Surrey, UK
Posts: 126
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
jonthewebb
Default

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #5  
Old 03-02-2004, 08:16 AM
New Member
 
Join Date: Mar 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
crisp
Default

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'
I've tried with cookie path '/catalog' and 'catalog/' also...

Thanks for your quick replies,

Cristian
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #6  
Old 03-02-2004, 08:40 AM
Member
 
Join Date: Jan 2004
Location: edmonton, Alberta, Canada
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
peteyg
Default

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #7  
Old 03-02-2004, 08:44 AM
New Member
 
Join Date: Mar 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
crisp
Default

Nope. It's not working.

(
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #8  
Old 03-02-2004, 08:55 AM
New Member
 
Join Date: Mar 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
crisp
Default

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #9  
Old 03-02-2004, 08:56 AM
Member
 
Join Date: Jan 2004
Location: edmonton, Alberta, Canada
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
peteyg
Default

Do you want to use SSL?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #10  
Old 03-03-2004, 04:05 AM
New Member
 
Join Date: Mar 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
crisp
Default

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -8. The time now is 11:05 PM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax