Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Cookies Problem


jack_frost

Recommended Posts

Sorry to make two topics in one day, but this is driving me insane!

 

My website has been acting change lately (or maybe ive just noticed it now, and it has been acting strange all along)

 

When putting something in the shopping cart, and returning to the index.php the shopping cart in the right side of the webpage sometime doesnt update. It says "0" - But if i go to, lets say, Shipping.php. the shopping cart displays the added item. (as if the browser pulls the allready loaded old loaded version of index.php)

 

If i then add another item to the shopping cart and return to the index.php, i still see nothing, and if i go to the shipping.php i only see the first added item, but if i then go to another part of the site, i see both added items.

 

If i wait for 5 minutes, eventually the Index.php and the shipping.php versions of the shopping cart will display correctly, it is as if the Cookies or the Refresh respond time is very slow on my site.

 

It doesnt help hitting F5 and it does this in both Firefox, Chrome and Safari.

 

The two main places on the site where it happens is the shopping Cart in the right menu, and when Logging off and returning two the Index.php (then the "Log Off" botton is still displayed, and useusally keeps displaying for 3-4 minutes, before refresheing the site will make it disappear.

 

in Configure.php my cookies settings looks like this:

 

define('HTTP_COOKIE_DOMAIN', '');

define('HTTPS_COOKIE_DOMAIN', '');

define('HTTP_COOKIE_PATH', '/');

define('HTTPS_COOKIE_PATH', '/');

 

I have recently change the two bottom ones from shopp/catalog/ because someone suggested that it would help, it did not.

 

Halpf?

 

- Jack

Link to comment
Share on other sites

@@Jack_frost

 

If your cart is installed into the /catalog directory, then you have to make the cookie path reflect that. However, you cookie domains must also be set.

 

 

define('HTTP_SERVER', 'http://www.yourdomain.com');

define('HTTPS_SERVER', 'http://www.yourdomain.com');

define('ENABLE_SSL', false);

define('HTTP_COOKIE_DOMAIN', 'www.yourdomain.com');

define('HTTPS_COOKIE_DOMAIN', 'www.yourdomain.com');

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

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

 

note: ensure your server and your domain are set up the same. If you do not include the www in the server definition, then do not include it on the domain definition.

 

 

 

Chris

Link to comment
Share on other sites

Hi!

 

Didnt under stand the last part.

 

This is my path:

 

www.fatima.dk/shopp/catalog/

 

And this is my configure file:

 

define('HTTP_SERVER', 'http://fatima.dk');

define('HTTPS_SERVER', 'http://fatima.dk');

define('ENABLE_SSL', false);

define('HTTP_COOKIE_DOMAIN', '');

define('HTTPS_COOKIE_DOMAIN', '');

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

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

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

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

 

what should it look like?

 

- Jack

Link to comment
Share on other sites

A Little bonus info:

 

In my Admin -> Configure -> Sessions

 

This is my setup as it looks now:

 

Session Directory : /tmp

Force Cookie Use: False

Check SSL ID: False

Check User Agent: False

Check IP-Adress: False

Prevent Spider Sessions: True

Recreate Sessions: True

 

Should i change any of these? (How do i check if i have php 4.1 as required by "recreate Sessions"

 

- Jack

Link to comment
Share on other sites

Hi Chris

 

If i change it to:

 

define('HTTP_SERVER', 'http://fatima.dk');

define('HTTPS_SERVER', 'http://fatima.dk');

define('ENABLE_SSL', false);

define('HTTP_COOKIE_DOMAIN', 'fatima.dk');

define('HTTPS_COOKIE_DOMAIN', 'fatima.dk');

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

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

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

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

 

Then i am no longer able to log in (as a customer)

 

It makes it worse! :P

Link to comment
Share on other sites

I GOT IT!

 

It wasnt poor little OsC's fault at all, it was my damn hosting company!

 

Theyve upgraded to Litespeed, which screws up my Cache!

 

I fixed it by adding this string of code to my Htacces file:

 

RewriteEngine on

RewriteRule (.*) - [E=Cache-Control:no-cache]

 

Succes!

 

Thanks though!

 

- Jack

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...