Re: very strange session behavior -- fails on port 80, works on 9090
| From: | Shawn McKenzie | Date: | Fri, 20 Mar 2009 15:26:48 +0000 |
| Subject: | Re: very strange session behavior -- fails on port 80, works on 9090 | ||
| References: | 1 | Groups: | php.general php.general |
| Request: | Send a blank email to php-general+get-290376@lists.php.net to get a copy of this message | ||
francisco j sanchez wrote:
> hello. I have been working on this bug for days now, and have scoured
> these forums and the web to no avail. I am fairly new to PHP, so
> please forgive me if I don't provide the right info.
>
> here is the problem:
> as of 9 days ago, when someone arrives at a document on our site via
> google (or directly to a document on our site via any method), and
> they add it to their cart, and then navigate to the cart, it is empty.
> if you navigate around the site first, all is well.
>
> here is the grand anomaly:
> i have the EXACT SAME code running on 80 and 9090 (normally, 9090 is a
> testing site pointing to its own directory, but since this bug
> surfaced, i've changed things). The bug can be reproduced over and
> over again on 80, and never on 9090. they are also using the same db.
>
> here is how to recreate it:
> go to http://www.examplemotion.com/legaldoc/view.php/112 and
> add to
> cart. check the cart by clicking the "Cart" link in the nav. it is
> empty. now, go to
> http://www.examplemotion.com:9090/legaldoc/view.php/112 and add
> to
> cart. check the cart by clicking the same nav link, and the doc is
> there, in the cart. ??? clear your cookies to reproduce, and, don't
> be logged in.
>
> here is some background:
> i am using Qcodo 0.5, PHP 5.2.6, apache 2.2, mysql 14.12. box and
> services hosted by godaddy. i have reverted the repo (SVN) to a known
> working version with the same results. in any file that you land on,
> including view.php, there is a call to
> require_once(../includes/prepend.inc.php) which calls session_start().
> although, i understand that is implicit with any $_SESSION['foo']
> assignments. in any case, session_start() should be called within
> prepend.inc.php. the id of the doc is successfully added to the
> session variable $_SESSION['cart'] in an array, and can be output to
> the page after adding the doc, but when you navigate away (either by
> going to the cart directly, or clicking 'checkout'), the session
> variable has disappeared. when clicking on checkout, it should take
> you to the register/login page, unless the cart is empty, in which
> case you are redirected to the search page.
>
> please let me know if you need any more information. any help would
> be _very_much_appreciated_!!!
>
> thanks!
>
> --fjs--
>
>
It's a cookie problem. When you visit http://www.examplemotion.com and
click add to cart and then click any link it the nav the links in the
nav point to http://examplemotion.com (notice the absence of
www). The
cookie is per domain and www.examplemotion.com is different than
examplemotion.com depending on your settings.
--
Thanks!
-Shawn
http://www.spidean.com