Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Session ID's lost after server move - help please!


Guest

Recommended Posts

Hi all,

 

Well, this is a tricky one... I am 99% sure it's an issue with the new server - the site works perfectly on the old server and locally. I've just spent 2 days trying to figure this out...

 

The old version is at the following address:-

Old Server

 

The New Version

New Server

 

The problem is that the new server appears to be losing the session ID, and the basket not working correctly

 

I added print_r(SID); to the bottom of header php, to trace the session ID.

 

The code and the database is exactly the same on both sites, with the excaption of the configuration.php files.

 

There seem to be 2 problems

Even refreshing the page on the new server looses the session ID - it's almost as if it is reading a different header.php. If I change the config file to use http://wasp.xssl.net/speedplumb.co.uk/catalog then the session ID stays.

 

This is demonstrated with a 3rd catalog install, all using the same files - test catalog

 

I think this may be related, but adding products by putting a quantity in the qty box and clicking add to cart results in them not being added to the cart.

 

If anyone can help me with what the issue is that I need to raise with the hosts or any guidance at all then I would really really grateful. If you need to see any code snippets or the effect of changing the config file then please let me know.

 

Many thanks in advance

 

Harv

Link to comment
Share on other sites

Even refreshing the page on the new server looses the session ID - it's almost as if it is reading a different header.php. If I change the config file to use http://wasp.xssl.net/speedplumb.co.uk/catalog then the session ID stays.

 

I am guessing from the above that you are attempting to use a shared ssl certificate. If this is the case, there is a missing "s" and this should be https://...

 

Check the HTTPS... settings in your config file, for the missing "s". Also, try turning off ssl until you make sure that the basic store works, then turn it back on.

Link to comment
Share on other sites

I am guessing from the above that you are attempting to use a shared ssl certificate. If this is the case, there is a missing "s" and this should be https://...

 

Check the HTTPS... settings in your config file, for the missing "s". Also, try turning off ssl until you make sure that the basic store works, then turn it back on.

 

 

Hi there - thanks for the speedy reply.

 

I did test using the shared SSL cert, but turned the SSL off when the site broke - I should have said the site did work for a brief while, but I think the stopped working when the hosting company turned the GD library on.

 

The reason for the site at http://wasp.xssl.net/speedplumb.co.uk/catalog is that the print session ID stays below the breadcrumb all the time. On the http://www.speedplumb.co.uk/catalog it goes away even on the first refresh, I can't figure that out at all.

 

The config file is as below.

 

define('HTTP_SERVER', 'http://www.speedplumb.co.uk'); // 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.speedplumb.co.uk');

define('HTTPS_COOKIE_DOMAIN', '');

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/');

 

Many thanks,

 

Harv

Link to comment
Share on other sites

The reason for the site at http://wasp.xssl.net/speedplumb.co.uk/catalog is that the print session ID stays below the breadcrumb all the time. On the http://www.speedplumb.co.uk/catalog it goes away even on the first refresh, I can't figure that out at all.
Nothing wrong with the sessions, if I put something in the shopping cart, the site remembers it. It looks like you didn't add the necessary code for the add_slave to the application_top.php for the new site, because there nothing happens (adding to the cart on the product_info page, in contrast to the test site).
Link to comment
Share on other sites

Nothing wrong with the sessions, if I put something in the shopping cart, the site remembers it. It looks like you didn't add the necessary code for the add_slave to the application_top.php for the new site, because there nothing happens (adding to the cart on the product_info page, in contrast to the test site).

 

Thanks for this - the odd thing is that all 3 sites run off exactly the same files - there is absolutely nothing different except for the config files between the 3 sites. All were uploaded from exactly the same source in exactly the same way.

 

Are there any php config options which could stop the add_slave working on the new server?

 

Regards,

 

Harv

Link to comment
Share on other sites

Are there any php config options which could stop the add_slave working on the new server?
No, action=buy_now works (e.g. use the form on http://www.speedplumb.co.uk/catalog/index.php?cPath=64_65_94 or if you single out a slave, go to its page and add &action=buy_now manually to the url. "Only" action=add_slave is consistently not working. I don't see anything different in the source code from a site I know uses master products. The HTML is a bit funny ( size="4"maxlength="4" without a space in between) but that shouldn't make any difference.

 

The shopping cart stays full when going from page to page, so again, nothing wrong with your sessions.

Link to comment
Share on other sites

To use the shared SSL on your server these are the correct settings:

 

define('HTTP_SERVER', 'http://www.speedplumb.co.uk');

define('HTTPS_SERVER', 'https://wasp.xssl.net/speedplumb.co.uk');

define('ENABLE_SSL', true);

define('HTTP_COOKIE_DOMAIN', 'www.speedplumb.co.uk');

define('HTTPS_COOKIE_DOMAIN', ''); //leave this blank

define('HTTP_COOKIE_PATH', '/catalog/');

define('HTTPS_COOKIE_PATH', ''); // leave this blank

define('DIR_WS_HTTP_CATALOG', '/catalog/');

define('DIR_WS_HTTPS_CATALOG', '/catalog/');

 

Vger

Link to comment
Share on other sites

To use the shared SSL on your server these are the correct settings:

 

define('HTTP_SERVER', 'http://www.speedplumb.co.uk');

define('HTTPS_SERVER', 'https://wasp.xssl.net/speedplumb.co.uk');

define('ENABLE_SSL', true);

define('HTTP_COOKIE_DOMAIN', 'www.speedplumb.co.uk');

define('HTTPS_COOKIE_DOMAIN', ''); //leave this blank

define('HTTP_COOKIE_PATH', '/catalog/');

define('HTTPS_COOKIE_PATH', ''); // leave this blank

define('DIR_WS_HTTP_CATALOG', '/catalog/');

define('DIR_WS_HTTPS_CATALOG', '/catalog/');

 

Vger

 

 

Thanks for this - have now enabled the SSL, once I get the site fixed, I'll look at getting the proper SSL cert for the domain name rather than a shared one. PS, is the https cookie domain not important?

 

Harv

Link to comment
Share on other sites

No, action=buy_now works (e.g. use the form on http://www.speedplumb.co.uk/catalog/index.php?cPath=64_65_94 or if you single out a slave, go to its page and add &action=buy_now manually to the url. "Only" action=add_slave is consistently not working. I don't see anything different in the source code from a site I know uses master products. The HTML is a bit funny ( size="4"maxlength="4" without a space in between) but that shouldn't make any difference.

 

The shopping cart stays full when going from page to page, so again, nothing wrong with your sessions.

 

Thanks,

 

I've fixed the problem with the space, but that hasn't made any difference.

 

The only 2 references to add_slave in the whole site are as follows :-

In product_info

<td width="100%" valign="top"><?php echo '<form name="buy_now_" method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_slave', 'NONSSL') . '">'; ?><table border="0" width="100%" cellspacing="0" cellpadding="0">

 

and in application_top

 

case 'add_slave' :

while ( list( $key, $val ) = each( $HTTP_POST_VARS ) ) {

if (substr($key,0,11) == "Qty_ProdId_") {

$prodId = substr($key,11);

$qty = $val;

if ($qty <= 0 ) continue;

 

$cart->add_cart($prodId, $cart->get_quantity(tep_get_uprid($prodId, $HTTP_POST_VARS['id']))+($qty), $HTTP_POST_VARS['id']);

 

}

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

 

I've just checked all the files which master products changes, and everythign seems correct. What really bothers me is the fact that all this code works perfectly on both my local machine, and Old Server when nothing has changed at all.

 

Do you think I should be looking in the master products support thread for help?

 

Regards,

 

Harv

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...