Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Empty Basket Problem when going live on domain


TomCavendish

Recommended Posts

When using my hosting account URL in includes/configure.php

 

http://******.*******.net/~*******

 

and then use that address to access my site, I can add products to the cart and everything works fine.

 

 

However, when I use the proper domain name in includes/configure.php

 

http://*****************.co.uk

 

and then use that address to access my site, the site works fine until when adding a product to the cart I get the "cart is empty" message.

 

Anyone able to help point me in the right direction so that I can put my site live?

 

Thanks for any help you can give,

 

TC

Link to comment
Share on other sites

Generally a cookies/sessions issue check the cookie paths in your configure.php file

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

Link to comment
Share on other sites

Generally a cookies/sessions issue check the cookie paths in your configure.php file

 

Hi Richard,

 

I have done a few OSC sites in the past and none of them have cookies defined in the configure.php file and they work fine.

 

However, I'm not sure where else the cookies could be defined?

Link to comment
Share on other sites

In includes/configure.php the http_cookie_domain should read www.yourdomain.com (no http:// in front of the www.)

 

The https_cookie_domain (for a full ssl cert) should read either www.yourdomain.com or just yourdomain.com (depending on how the cert was issued).

 

For https_cookie_domain on a shared ssl it's not so clear cut, but if your https_catalog link said https://yourserver.yourhost.com/yourdomain.com then your https_cookie_domain would be yourhost.com/yourdomain.com

 

Vger

Link to comment
Share on other sites

In includes/configure.php the http_cookie_domain should read www.yourdomain.com (no http:// in front of the www.)

 

The https_cookie_domain (for a full ssl cert) should read either www.yourdomain.com or just yourdomain.com (depending on how the cert was issued).

 

For https_cookie_domain on a shared ssl it's not so clear cut, but if your https_catalog link said https://yourserver.yourhost.com/yourdomain.com then your https_cookie_domain would be yourhost.com/yourdomain.com

 

Vger

 

Hi Vger,

 

There are no cookie defines in my configure.php file, and there have not been on other OSC installations that I've done before (and they all work).

 

In fact it's the same hosting company as the other sites and the only thing that changes is the

 

define('HTTP_SERVER',

define('HTTPS_SERVER'

 

define('DIR_FS_DOCUMENT_ROOT', '

define('DIR_FS_CATALOG', '

 

and db connections (all in configure.php)

 

The rest is exacely the same as a site that works.

 

the https shouldn't actually matter with regard to adding to cart, as that does not come in until after the cart stage.

 

It's driving me nuts because I'm keen to launch the site :blink:

 

Thanks for trying to help.

Link to comment
Share on other sites

There are no cookie defines in my configure.php file, and there have not been on other OSC installations that I've done before (and they all work).

 

In fact it's the same hosting company as the other sites and the only thing that changes is the

 

define('HTTP_SERVER',

define('HTTPS_SERVER'

 

define('DIR_FS_DOCUMENT_ROOT', '

define('DIR_FS_CATALOG', '

 

and db connections (all in configure.php)

 

The rest is exactly the same as a site that works.

 

So add them. Somewhere along the line they obviously were deleted.

 

Stock configure.php

 

<?php

/*

$Id: configure.php,v 1.14 2003/07/09 01:15:48 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

// Define the webserver and path parameters

// * DIR_FS_* = Filesystem directories (local/physical)

// * DIR_WS_* = Webserver directories (virtual/URL)

define('HTTP_SERVER', ''); // 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', '');

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_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', dirname($HTTP_SERVER_VARS['SCRIPT_FILENAME']));

define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');

 

// define our database connection

define('DB_SERVER', ''); // eg, localhost - should not be empty for productive servers

define('DB_SERVER_USERNAME', '');

define('DB_SERVER_PASSWORD', '');

define('DB_DATABASE', 'osCommerce');

define('USE_PCONNECT', 'false'); // use persistent connections?

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

?>

Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux

Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management)

Link to comment
Share on other sites

Hi Alan,

 

Tried the cookie defines but to no avail. I've set up 4 other OSC sites, and none have the cookie defines either and they work.

 

When I set up this new site, I copied across the database from an existing OSC site and all the files too.

 

In theory, just changing the configure.php files and some permissions should have had the new site working on the domain.

 

Strange that the add to cart works on the hosts temp url, but not the proper url.

 

Thanks for trying to help.

 

TC.

Link to comment
Share on other sites

Hi Alan,

 

Tried the cookie defines but to no avail. I've set up 4 other OSC sites, and none have the cookie defines either and they work.

 

When I set up this new site, I copied across the database from an existing OSC site and all the files too.

 

In theory, just changing the configure.php files and some permissions should have had the new site working on the domain.

 

Strange that the add to cart works on the hosts temp url, but not the proper url.

 

Thanks for trying to help.

 

TC.

The COOKIE_DOMAINS aren't defined just for the fun of it.

 

catalog/admin/includes/classes/sessions.php:34: var $cookie_domain = '';

catalog/admin/includes/classes/sessions.php:415: setcookie($session->name, $session->id, $session->cookie_lifetime, $session->cookie_path, $session->cookie_domain);

catalog/includes/application_top.php:116: $cookie_domain = (($request_type == 'NONSSL') ? HTTP_COOKIE_DOMAIN : HTTPS_COOKIE_DOMAIN);

catalog/includes/application_top.php:116: $cookie_domain = (($request_type == 'NONSSL') ? HTTP_COOKIE_DOMAIN : HTTPS_COOKIE_DOMAIN);

catalog/includes/application_top.php:116: $cookie_domain = (($request_type == 'NONSSL') ? HTTP_COOKIE_DOMAIN : HTTPS_COOKIE_DOMAIN);

catalog/includes/application_top.php:135: define('PHP_SESSION_DOMAIN', $cookie_domain);

catalog/includes/application_top.php:150: session_set_cookie_params(0, $cookie_path, $cookie_domain);

catalog/includes/application_top.php:154: ini_set('session.cookie_domain', $cookie_domain);

catalog/includes/application_top.php:154: ini_set('session.cookie_domain', $cookie_domain);

catalog/includes/application_top.php:167: tep_setcookie('cookie_test', 'please_accept_for_session', time()+60*60*24*30, $cookie_path, $cookie_domain);

catalog/includes/classes/sessions.php:34: var $cookie_domain = PHP_SESSION_DOMAIN;

catalog/includes/classes/sessions.php:418: setcookie($session->name, $session->id, $session->cookie_lifetime, $session->cookie_path, $session->cookie_domain);

catalog/includes/configure.php:19: define('HTTP_COOKIE_DOMAIN', '');

catalog/includes/configure.php:20: define('HTTPS_COOKIE_DOMAIN', '');

catalog/includes/functions/html_output.php:49: if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) {

catalog/includes/functions/html_output.php:49: if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) {

 

It's a safe bet to say you've never seen the session ID disappear from the address bar on any of your other set ups.

Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux

Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management)

Link to comment
Share on other sites

The COOKIE_DOMAINS aren't defined just for the fun of it.

 

It's a safe bet to say you've never seen the session ID disappear from the address bar on any of your other set ups.

 

I've been through the other sites and the session ID's do disappear from the address bar. So all is fine with them. I must have done something on the first one which means they are not required in configure.php.

 

I'm starting again with this latest site... :blush:

Link to comment
Share on other sites

I've narrowed it down and hope this may help someone.

 

I re-uploaded a copy of the site again (complete without cookie defines in configure.php).

 

I then deleted the cache and sessions from folders and in the db.

 

The site then worked on the proper domain (yippee).

 

However, when SEO URL's (v2.0) was switched on and then off, the problem with not being able to add to cart returned.

 

After that you can't add to cart regardless of SEO URL's being on or off.

 

The problem seems to be with regard to switching on/off SEO URLs vers 2.0. and nothing to do with the configure.php settings.

 

I've had a quick read about the latest version of SEO URL's and found an acknowledgment of a problem with switching off the feature in an early version, but not any detail of what problems it caused or how to fix it. Only saying to upgrade to the latest version.

 

I hope this helps others who have had the same problem.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...