Strange login problem - won't create cookie
Logging in to our site also auto logs in to the cart. No problem on our beta site, login creates zen cookie like it should, cart available for purchases. Not so with the production site. Logging in doesn't create zen cookie until l log in from the cart itself. have racked my brain and code to find the difference between production and beta domains but no luck. Just hoping someone else has run in to this and has a suggestion..
Thanks,
George
Re: Strange login problem - won't create cookie
If you've got two sites and one works fine but the other doesn't, and the problem is session-related, I'd start by comparing the PHP configuration settings between the servers.
Then I'd look at the domains and what domain is being set in the cookies that do work.
Then I'd be testing in multiple browsers.
I'd also be checking whether the SSL URL is the same as the non-SSL. If not, then cookies can be problematic.
ANd is your SSL set correctly for the domain it's registered to. ie: are you mixing www. and non www. prefixes?
Re: Strange login problem - won't create cookie
Ok, forgot to mention one thing, this only happens in firefox on PC and Mac. Works fine in other browsers, IE, Chrome, Safari...weird....
Re: Strange login problem - won't create cookie
As I re-read your comments I think the SSL prefixes might be worth looking into. As I mentioned, this only happens in Firefox. Something I'm missing in the browser setup maybe? but beta works which brings me back to SSL. Beta is non-SSL while production SSL enabled. Must be a domain prefix issue, but why work on other browsers? This kind of problem makes me go bald....
thanks,
George
Re: Strange login problem - won't create cookie
Okay, definitely a domain prefix problem in the zenid cookie. Domain is listed as .www.piccexcellence.com. It should be .piccexcellence.com. My problem is I don't know where that domain value is being set for the zenid cookie. both path.php and pathcart.php show correct cookie paths. I've gone through the cart configuration files but find no setting for domain, frankly the Zen code is several levels above my understanding of PHP so I try to do as little as possible with it. Anyway, that seems to be a possible cause, just don't know where it's being set....
G.
Re: Strange login problem - won't create cookie
1. What is the domain name to which your SSL certificate was issued?
2. What is your HTTP_SERVER and HTTPS_SERVER set to in your /includes/configure.php file?
If your SSL cert is issued to www.your_domain.com then you should be using the www. in your HTTP_SERVER and HTTPS_SERVER settings, else you'll have a mismatch.
Re: Strange login problem - won't create cookie
The SSL certificate lists both as common names: www.piccexcellence.com and piccexcellence.com. The includes/configure.php file uses www.piccexcellence.com for both HTTP_SERVER and HTTPS_SERVER. I experimented by changing these values to piccexcellence.com. This seems to have corrected the problem.
Thank You,
George Moureau
PICC Excellence, Inc.
Re: Strange login problem - won't create cookie
Thanks for confirming that being consistent with the correct URL solved the problem.
Re: Strange login problem - won't create cookie
Just confirming that changing the values in configure.php did correct the problem and wanted to say Thank You very much. Great Resource, much appreciated. Also do you have any recommendations for online training tools that would help me understand the php code used by zen cart. I realize it's object oriented however I just have basic php programming skills and would like a further understanding of the code.
Thanks Again,
George
Re: Strange login problem - won't create cookie
Quote:
Originally Posted by
George_Moureau
Just confirming that changing the values in configure.php did correct the problem and wanted to say Thank You very much. Great Resource, much appreciated. Also do you have any recommendations for online training tools that would help me understand the php code used by zen cart. I realize it's object oriented however I just have basic php programming skills and would like a further understanding of the code.
Thanks Again,
George
George, I'd suggest starting with an existing plugin that you'd like to add to your store. Download it and look at the code that's changed and the function that it's providing. Depending on the plugin, it might give you a sense of what's going on.
Although it's a bit dated, the "Zen Cart Program Flow" documentation (http://www.zen-cart.com/downloads.php?do=file&id=249) will give you an overview of what's loading what and why.
Another approach is to start with /index.php and follow its include/require paths to get a feel for what's happening. Pick a "simple" page (like privacy) and just follow the php code from start to finish.
There's also www.php.net that has a lot of good PHP information.