Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PLEASE - sessions not staying put, losing cart, etc.


sfatula

Recommended Posts

I have a site running. I go the site, and I have cookies turned off. It is 2.2. PHP 4.2.2 is loaded. With cookies off, I go and buy an item. It goes to the cart page and says NOTHING is in the cart. Half the time, there is something in the cart, but clicmking on any link then removes it.

 

I loaded a VIRGIN 2.2 installation on my own Linux server, no mods. Same result. I cannot shop without cookies being set on! The cart simply does not keep it's contents.

 

I notice the session ID constantly changing, which undoubtedly is the problem.

 

Right after the tep_session_start call in application_top.php, the session ID is wrong. It is already different than the previous session ID.

 

Does anyone have a functional 2.2 install, using PHP 4.2.0+, that works when they turn cookies OFF? If so, is there any way you can post the php.ini file, or the server info screen so I can tell why yours work and mine does not?

Steve

Link to comment
Share on other sites

I tested this too ...

 

1 turn off the cookies

2 close all browser windows

3 delete all customer basket info about you

4 kill all cookies to your site

 

Now go in and test. Is it still broke?

 

Do you have anything added like a different categories box than the original? A different manufactures' box than the original? Anything that might effect the passing of the current sid?

 

On my site ... I have a nice Category Scroll box. Unfortunately, if you use it will all the cookies stuff above done ... it breaks everything. :shock:

 

When I turn that off and go back to the real Categories box ... it's all fixed ... just like magic. :D

 

Just make sure in testing you kill off anything that might setup an initial confusion to the sid in the first place. Then go test and see what link or set of links is really breaking the store.

Link to comment
Share on other sites

I tested with a virgin install, i.e. NO changes. It still doesn't work for me. I do see some sites working. So, I suspect it is a configuration or version issue. Both sites that fail use 4.2.0+ of PHP. Client is the same, IE 5.5

 

Can you email me your server_info.php output? And/or, your PHP.INI settings? Along with what version of PHP you are using?

 

I see other users out there have reported this issue with no solution yet. So, I am not alone!

 

I did some extensive testing. I had application_top down to bare minimums, one of the first things it does with my test version is the session_start, and the nunber is already wrong long before it gets to any form.

Steve

Link to comment
Share on other sites

perhaps it is easier if you post a link to your phpinfo page :)

"Politics is the art of preventing people from taking part in affairs which properly concern them"

Link to comment
Share on other sites

Yes, I am storing sessions in MySQL which is *required* to have a secure server on a different physical machine. I think it is better anyway.

 

Doesn't matter, I turn it off, same thing. No difference as far as the problem goes.

 

Yes, the SID changes every single time I click on a link.

 

Happens with virgin OSC install, on two different hosts.

 

One has PHP 4.2.0, and one has 4.2.2. Yes, register globals is enabled. EVERYTHING works great unless you shop with cookies disabled.

 

If someone specifically wants a copy of MY PHPINFO, I will gadly email it to them, it's too big to put in this thread. But that's working backwards, to me, it makes more sense if a person using PHP4.2.0+ simply emails me their PHPINFO output, perferably, with a link to their site as well so I can shop.

Steve

Link to comment
Share on other sites

I'm having this problem too, yesterday it was working perfect, we didn't make any changes today and this afternoon when adding any product to the car. i receive the message that the car is empty :(

 

here it's the link to a product (we just have 2 now, and it's hapenning with both)

 

http://www.animekai.com/tienda/mx/product_...70b703e246d5c4e

 

 

hope you can help soon, thanks :wink:

Link to comment
Share on other sites

it's too big to put in this thread. But that's working backwards, to me,

 

Just make a file called phpinfo.php and put this in the file:

 

<?php

phpinfo()

?>

 

Put the file in your directory and post a link here. I think that would be easiest.

Link to comment
Share on other sites

I was just fooling some more with settings to see if anything else broker the cart, etc.

 

One thing that breaks it on everything is a customer comes in with cookies off and you have Search Engine Friendly URLs turned on.

 

As soon as I have it on ... everything gets lost from the cart or never gets there.

 

Turn this off ... now everything works great.

 

Might check to see if you are using this setting in the Admin.

Link to comment
Share on other sites

Sara, you indeed have a problem, it is not the same as my problem. Hopefully, your's is easier to find! I went to your site and the session ID does not change with cookies off like mine does.

Steve

Link to comment
Share on other sites

Here's a very small program to exhibits exactly what happens on my site with OSC. Upload it to a machine that works and call it default_test.php, ideally with PHP 4.2.0-4.2.2, and run it WITH COOKIES DISABLED. Change the link linux.office.home to your site. Click on the link. Is there a session ID shown on the address line in the browser? Click the link again. Is it still there and the same? Mine is BLANK on the second click, clicking again gives a session ID again, but it is different. It works great with cookies enabled, but that is not the test. Run it with ALL cookies disabled.

 

I have looked over a site where this works, checked the PHPINFO, and I see no difference between theirs and mine. Weird. I have two different computers with two different OSs with 2 different PHP versions, and both fail.

 

<?php

session_name('Steve');

session_start();

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html">

<title>Test Page</title>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<?php echo '<a href="http://linux.office.home/catalog/default_test.php?' . SID . '">link to me</a>'; ?>

</body>

</html>

Steve

Link to comment
Share on other sites

Cool, that's what I wanted to know. I suspected it would work perfectly on a functioning site. I have confirmed other OSCommerce sites that have this problem though. The question of course is WHY!

 

I suppose this is more of a PHP question. I am going to pose it on the PHP support site. Can you keep this very small useless program on your site for a while to prove to others it works?

Steve

Link to comment
Share on other sites

I can keep it there as long as you like. It does not take up much space and as long as I do not forget and kill the directory for some reason, it will be there for you.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...