Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sessions a general overview ?


stevejebson

Recommended Posts

I'm having trouble with my store (www.hitekhairtools.co.uk) in that when the user arrives at the login.php page (on shared ssl) the cart is empty. A session ID appears in the url at the login.php. I've cheked the session file on the db and it's there but no cart info. Can somebody explain in laymans terms how, why and when a session is created and how,why and when the cart data is stored in it. Maybe that's why i'm not seeing ny data at the login.php.

 

All the more infuriating is that 2 people have been able to place orders so they appear not to have the problem ! Tom suggested yesterday that it might be to do with "Check IP address" setting in configuration/settings but i have tried false and true with no success (btw all these settings are false, is this correct ?)

 

i've been trying to resolve this for a week now with no sucess, any help will cheer my family as much as me !

 

steve

Link to comment
Share on other sites

In addition to http://www.oscommerce.com/forums/index.php?sho...ndpost&p=574876

 

You also have to change the following line back to original

define('DIR_WS_HTTPS_CATALOG', '');

to

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

 

 

Ok, here is my current configure.php but it still doesn't work ! as soon as i get to the login.php the cart has disappeared !

 

define('HTTP_SERVER', 'http://www.hitekhairtools.co.uk'); // eg, http://localhost - should not be empty for productive servers

 

 

define('HTTPS_SERVER', 'https://secure1.merchantservices.net/hitekh1'); // !!!! this eg, https://localhost - should not be empty for productive servers

define('ENABLE_SSL', true); // secure webserver for checkout procedure? // !!!! this

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

define('HTTPS_COOKIE_DOMAIN', 'secure1.merchantservices.net/hitekh1');

define('HTTP_COOKIE_PATH', '');

define('HTTPS_COOKIE_PATH', ''); // !!!! this

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', 'c:/inetpub/wwwroot/PHP/hitek/catalog/');

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

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

 

// define our database connection

define('DB_SERVER', 'mysql-2.db.vi.net'); // eg, localhost - should not be empty for productive servers

define('DB_SERVER_USERNAME', 'hitekh');

define('DB_SERVER_PASSWORD', 'removed for this post ');

define('DB_DATABASE', 'hitekh');

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

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

Link to comment
Share on other sites

Also try changing

define('HTTP_COOKIE_PATH', '');
define('HTTPS_COOKIE_PATH', '');

to

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

or

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

Link to comment
Share on other sites

Also try changing

define('HTTP_COOKIE_PATH', '');
define('HTTPS_COOKIE_PATH', '');

to

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

or

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

 

 

ok, tried both but not working (paths are currently set to /catalog/), if i looked at the session file in another window, when the session is created (appears to be at point of going to shared ssl) would i not expect the cart data to be in the session file record ? If so, maybe my cart is being lost somewhere around the session creation ??

Link to comment
Share on other sites

Let's try changing

define('HTTPS_COOKIE_DOMAIN', 'secure1.merchantservices.net/hitekh1');

to

define('HTTPS_COOKIE_DOMAIN', 'secure1.merchantservices.net');

 

The problem definately occurs at this point of catalog/includes/functions/html_output.php, where the session is being transfer from nonSSL to SSL

 

// Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined
? if ( ($add_session_id == true) && ($session_started == true) && (SESSION_FORCE_COOKIE_USE == 'False') ) {
? ? if (tep_not_null($SID)) {
? ? ? $_sid = $SID;
? ? } elseif ( ( ($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL == true) ) || ( ($request_type == 'SSL') && ($connection == 'NONSSL') ) ) {
? ? ? if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) {
? ? ? ? $_sid = tep_session_name() . '=' . tep_session_id();
? ? ? }
? ? }
? }

Link to comment
Share on other sites

ok, tried that but got "cgi headers" error, and didn't arrive at login.php, i suspect this is due to missing /hitekh1/ in url. should i put /hitekh1/ into the DIR_WS_HTTPS_CATALOG ? btw did you get my username/pw in the offline msg ?

Link to comment
Share on other sites

ok, tried that but got "cgi headers" error, and didn't arrive at login.php, i suspect this is due to missing /hitekh1/ in url.  should i put /hitekh1/ into the DIR_WS_HTTPS_CATALOG ? btw did you get my username/pw in the offline msg ?

Yes, I did get that msg.

 

I can't see anything else wrong with the configuration file, unless there is a contribution interfering with the Session Ids or Windows server problem (not very likely). And it's quite hard to debug from here.

 

Can you list all the contributions that you've installed?

Link to comment
Share on other sites

1 more thing. Are you hosting your site with fasthosts by any chance?

 

I've heard a lot of problems in the past, but not entire sure if that's related.

Link to comment
Share on other sites

Can you list all the contributions that you've installed?

 

Hmm, listing the conts installed will not be easy ! STS template, CVV, i'd have to check when i got home (currently at work!) I couldn't guarantee i'd be able to list all.... i get a horrible feeling i'm heading towards a rebuild here :'(

 

Windows server problem (not very likely).

 

souns like that may have potential... as this store has been working for 6 months and the problem only started occurring last week and i swear i hadn't changed any code, only added and removed products. Any thoughts on what kind of server changes may affect me ?

 

 

no, a company called www.vi.net (taken over by active24.com) over here in the uk.

Link to comment
Share on other sites

also, do you not think there is any mileage in the idea hat the session record is not being populated with the cart data before we go off to the shared ssl pages ? I can see that when i arrive at the login.php, (this is when the sessionID is appended to the url, should i see it beforehand ?) and i check the session record on the db it is there but there is no cart data in it.

Link to comment
Share on other sites

My first suspect would be STS. I've used it in the past (for about 2 days), then decided to drop the contribution, due to countless compatibility issues and a major database performance problem.

 

You might want to search the STS supporting thread.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...