Zen Cart Logo
Forums / Installing on a Windows Server / Someone stole my cookies!

Someone stole my cookies!

Views: 3,870

Results 1 to 20 of 20
24 May 2011, 2:43 AM
#1
tayers avatar

tayers

New Zenner

Join Date:
May 2011
Posts:
11
Plugin Contributions:
0

Someone stole my cookies!

I'm a Zen Cart 'newbie' that is working on evaluation of Zen Cart for our website (fruitlady.net).

I installed v1.3.9h on my home PC (Win XP) running Zen Cart under Wampserver 2.1.

Zen Cart installed OK. I can use admin functions to set of product/categories, and attributes. I set up a couple categories that match our website categories, and a couple products to 'experiment' with how it all works.

But ... when I log out from admin and go into Zen Cart, I can go to my categorys and see the products I added. However, when I press the 'Add to Cart' function, I get an error message telling me that my browser doesn't support cookies... although my browser does support cookies. I verified this several different ways (javascript 'sniffer' routines that display contents of navigator.cookieEnabled=TRUE), and can successfully add products to carts on Zen Cart demo sites.

I suspect that the error I'm getting results from failure to create/read cookies in my environment (local PC setup), but I'm at a loss to track down where the glitch is...

(Oh yeah, I installed the demo Zen Cart data, and my storefront is running within the demo. I haven't made any modifications so far).

Can anyone point me to something to look at or try to get past this glitch?

Thanx! :yes:

TbA

24 May 2011, 3:05 AM
#2
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,781
Plugin Contributions:
11

Re: Someone stole my cookies!

Not really a Zen Cart question, but have you checked the hosts file in the drivers/etc folder of your machine? Without the right setting there, you won't get a cookie.

24 May 2011, 3:32 AM
#3
tayers avatar

tayers

New Zenner

Join Date:
May 2011
Posts:
11
Plugin Contributions:
0

Re: Someone stole my cookies!

Sorry 'bout a non Zen question... but it has only shown up when I tried using my Zen Cart (my cookies are otherwise quite tasty!)

My prior experience has been in client side apps; i'm learning as I go along about server side requirements (and terminology).

I found a file 'hosts in my windows/system32/drivers/etc that contains:

Copyright (c) 1993-1999 Microsoft Corp.

This is a sample HOSTS file used by Microsoft TCP/IP for Windows.

This file contains the mappings of IP addresses to host names. Each

entry should be kept on an individual line. The IP address should

be placed in the first column followed by the corresponding host name.

The IP address and the host name should be separated by at least one

space.

Additionally, comments (such as these) may be inserted on individual

lines or following the machine name denoted by a '#' symbol.

For example:

102.54.94.97 rhino.acme.com # source server

38.25.63.10 x.acme.com # x client host

127.0.0.1 localhost
127.0.0.1 localhost

I have no clue what it ***should ***contain... to allow cookie creation. But it does seem to know about my localhost on my local address.

Perhaps I should bight the bullet and install Zen Cart on our web server; it would probably work then; albeit with a few more hassles for updates and FTP that I don't have on my local. (But I would be doing this sooner or later anyways; I just wanted it to be a bit later after I got a good feel for how Zen Cart would work for us). Until I got to my 'Add to Cart' glitch, it seems to be working fine and I'm going through the learning curve in seting up our storefront.

I'll do a bit of investigations on what should be in 'hosts' file and see if anything looks familiar!

Thanx!

TbA

24 May 2011, 3:48 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Someone stole my cookies!

You don't need to do anything to your hosts file for Zen Cart to allow cookie creation. What you quoted is perfectly normal for the majority of peoples' uses. You'd only add to that if you were adding additional domain names at specific IP addresses that didn't already have proper public DNS entries (and if you don't know what that means it probably isn't relevant to your concerns.)

However, if you're going to run it on your local machine, use "localhost" as the URL, and not the 127.0.0.1 IP address. ie: set HTTP_SERVER to 'localhost' and not to '127.0.0.1'

24 May 2011, 4:07 AM
#5
tayers avatar

tayers

New Zenner

Join Date:
May 2011
Posts:
11
Plugin Contributions:
0

Re: Someone stole my cookies!

Both of my configure.php files contain:

// Define the webserver and path parameters
// HTTP_SERVER is your Main webserver: eg-http://www.your_domain.com
// HTTPS_SERVER is your Secure webserver: eg-https://www.your_domain.com
define('HTTP_SERVER', 'http://localhost');
define('HTTPS_SERVER', 'https://localhost');
(the admin version also has similar entries for CATALOG_SERVER variables)
...

aarrgh! :)

TbA

24 May 2011, 6:13 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Someone stole my cookies!

Admin->Configuration->Sessions --- what have you changed here, and why? The defaults are generally appropriate for all sites, and should very rarely be changed.

24 May 2011, 1:48 PM
#7
tayers avatar

tayers

New Zenner

Join Date:
May 2011
Posts:
11
Plugin Contributions:
0

Re: Someone stole my cookies!

This is the current Configuration Sessions contents:

Sessions

Title Value
Session Directory C:/wamp/www/zencart/cache
Cookie Domain True
Force Cookie Use False
Check SSL Session ID False
Check User Agent False
Check IP Address False
Prevent Spider Sessions True
Recreate Session True
IP to Host Conversion Status true
Use root path for cookie path False
Add period prefix to cookie domain True

To the best of my recollection, I haven't made any changes here.
Are these the default values?

TbA

24 May 2011, 6:21 PM
#8
tayers avatar

tayers

New Zenner

Join Date:
May 2011
Posts:
11
Plugin Contributions:
0

Re: Someone stole my cookies!

I think I found something that address my missing cookies:

http://www.webmasterworld.com/forum21/11530.htm

I attempted to allow the localhost to set cookies in Internet Explorer but it would not let me do so because it requires a domain extension...
Any ideas of how to get around this?

In XP go to this directory...
C:\WINDOWS\system32\drivers\etc

Open the extensionless file named "hosts" with notepad.

Now you should see an example of...

102.54.94.97 rhino.acme.com # source server

So for example if you were running Apache locally and wanted to test a site locally but could not access it without a domain name then you could edit this file (with notepad) and then add the following line...

192.168.0.2 myexample.net

Clarification:
Router Users: Default Gateway is YOUR computer's local IP.
Non-Router Users: You can access your system via Apache via your IP address.

If you add that line (and I intentionally left out the amperstamp) then when you access that domain name (that you can change to) you can now access your local apache htdocs folder via that domain name.

Now of course you will want to use a domain name that works for you but also not block a website you are used to using.

It seems that cookies require a domain extension, but localhost won't accept one.
(Oh yeah, I use IE8 as my default browser. I sounds like this is an IE 'limitation, other browsers (and earlier IE) would set cookies without requiring a domain name...)

I'll update my 'hosts' file as suggested above, and see if that works. If so, I'll probably want to change my config.php file, changing occurances of localhost to 'myexample.net' (or the equivalent that I would use) ??

I'll post an update with my results! :lamo:

TbA

24 May 2011, 6:28 PM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Someone stole my cookies!

Or just use a much better browser instead. Dump IE and use FireFox.

24 May 2011, 10:56 PM
#10
tayers avatar

tayers

New Zenner

Join Date:
May 2011
Posts:
11
Plugin Contributions:
0

Re: Someone stole my cookies!

DrByte:

Or just use a much better browser instead. Dump IE and use FireFox.

Updates:

I added my local machine and testdomain.net to 'hosts' and re-booted. ping and tracert to testdomain.net worked as expected, but in trying to access any of my folders, I got HTTP 403 Forbidden error.

"This error (HTTP 403 Forbidden) means that Internet Explorer was able to connect to the website, but it does not have permission to view the webpage." ... I guess i'll need to look into WAMPServer settingsto get 'authorized' to use this new 'domain'. :lamo:

I also tried the shopping cart under Firefox (5.0), using the existing localhost access. It worked the same as IE; allowing access to the cart and admin, but giving me 'cookies are required' when I try to add to cart... :lamo:

Ah well, at least I'm eliminating some of the possibilities! :blush:

It's looking more practical to just install Zen Cart on our web host, and re-do my setup (dropping the demo data) and evaluation.

It's a good thing I'm doing this eval as a favor, and not on payroll! :yes:

TbA

24 May 2011, 11:09 PM
#11
vger avatar

vger

Past Contributor

Join Date:
Nov 2004
Location:
Norfolk, United Kingdom
Posts:
3,189
Plugin Contributions:
0

Re: Someone stole my cookies!

Sorry to contradict DrByte, but some softwares as well as some local servers do require a FQDN (Fully Qualified Domain Name), and 'localhost' does not cut it as a FQDN because there are no dots (periods) in 'localhost'.

The ip address 127.0.0.1 is just the ip address of 'localhost' but http://127.0.0.1 qualifies as a FQDN whereas http://localhost doesn't.

I recommend you use http://127.0.0.1 as the address (with the addition of the folder you installed the site in).

or ...you could try setting these to 'false'

Cookie Domain True
Add period prefix to cookie domain True
Recreate Session True

Vger

24 May 2011, 11:41 PM
#12
tayers avatar

tayers

New Zenner

Join Date:
May 2011
Posts:
11
Plugin Contributions:
0

Re: Someone stole my cookies!

Thanx for the suggestion, Vger.

I tried using http://127.0.0.1 but received the same results (a lurking cookie monster!). The 'root' folder contains index.php, which displays links to my installed apps (including Zen Cart) so I used that as a gateway.

I'm hesitant about mucking with default session settings; I could all too easily screw things up and not have any access! (I suppose these settings are in a congif or ini file somewheres, though, that I could manually reset?)

And since this is an evaluation exercise, as I noted above, it might be best to eval on a real web server. I've learned a lot about config and setting up categories and products in my local activities, so I'm not averse to doing it again, and then tweaking it so that it behaves the way I want it. It's just a bit more awkward and slower, but (hopefully) fully functional from that environment. :bangin: :lamo:

TbA

25 May 2011, 1:59 AM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Someone stole my cookies!

Vger:

Sorry to contradict DrByte, but some softwares as well as some local servers do require a FQDN (Fully Qualified Domain Name), and 'localhost' does not cut it as a FQDN because there are no dots (periods) in 'localhost'.
That may be true. But I use "localhost" an awful lot, and never run into the described problems.
Granted, I don't subject myself to the painful nonsense imposed by software written by Microsoft. Maybe that's the root cause of this situation.

25 May 2011, 2:01 AM
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Someone stole my cookies!

tayers:

it might be best to eval on a real web server.A real-world-test is always a far better determiner of actual functionality and usability. Trying to set up a localhost environment on an O/S that's not designed for that purpose can often be painful, and is never a good indicator of the real functionality or capability of the software. Nor is the typical localhost setup protected by any of the security measures implemented by proper real web server configurations.

25 May 2011, 5:58 AM
#15
willie_bee avatar

willie_bee

Zen Follower

Join Date:
Mar 2011
Posts:
386
Plugin Contributions:
0

Re: Someone stole my cookies!

DrByte:

That may be true. But I use "localhost" an awful lot, and never run into the described problems.
Granted, I don't subject myself to the painful nonsense imposed by software written by Microsoft. Maybe that's the root cause of this situation.

linux/unix always. much easier to deal with and more robust in my opinion, plus you're not adding patches every Patch Tuesday, har har!

25 May 2011, 12:14 PM
#16
vger avatar

vger

Past Contributor

Join Date:
Nov 2004
Location:
Norfolk, United Kingdom
Posts:
3,189
Plugin Contributions:
0

Re: Someone stole my cookies!

I suppose these settings are in a congif or ini file somewheres, though, that I could manually reset?

They are in the DBs 'configuration' file, which can be accessed at http://localhost/phpmyadmin - so you can manually edit those settings that way if needed.

Granted, I don't subject myself to the painful nonsense imposed by software written by Microsoft. Maybe that's the root cause of this situation.

In this case it's a linux based Intranet installed on a Windows PC. Although the original poster is using Wamp I see no difference to using this over XAMPP - and some versions of XAMPP require a FQDN. As do some softwares, such as Tomato Cart - based on your old nemesis (osCommerce).

Vger

25 May 2011, 3:58 PM
#17
tayers avatar

tayers

New Zenner

Join Date:
May 2011
Posts:
11
Plugin Contributions:
0

Re: Someone stole my cookies!

DrByte:

A real-world-test is always a far better determiner of actual functionality and usability. Trying to set up a localhost environment on an O/S that's not designed for that purpose can often be painful, and is never a good indicator of the real functionality or capability of the software. Nor is the typical localhost setup protected by any of the security measures implemented by proper real web server configurations.

Yeah, I know using a real environment is better for evals ... From several decades in IT tech support (IBM mainframe), software develepoment (Software AG), software testing, and most recently web design...

WAMP and local host has served (pretty) well in converting and testing our website to use PHP, and almost works for evaluating Zen Cart ... until cookies were required and not available! :frusty:

Live and learn! :blush:

TbA

25 May 2011, 4:56 PM
#18
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Someone stole my cookies!

What surprises me most is the fact that hundreds of people (as evidenced by as many forum threads on the topic) have used WampServer and Xamp and others, and never ran into the problems you mention, such as cookie problems or FQDN requirements. "localhost" has worked fine for everyone as far as I can recall.

Maybe it's something new in whatever Wamp version you've selected?

26 May 2011, 11:02 PM
#19
tayers avatar

tayers

New Zenner

Join Date:
May 2011
Posts:
11
Plugin Contributions:
0

Re: Someone stole my cookies!

An update:

I uploades Zen Cart to our webserver, configured it, and added a few products.

When I used the web server shopping cart, I encounter the same problem (cookies not enabled) when adding to cart; both with IE and Fierfox... and with or without ZoneAlarm Firewall being enabled...

:frusty: :frusty:

But, I had a few more tricks to try...

I started up my old desktop PC that's running Win 2k, IE6, and connected to the shopping cart. And, I was able to add items, and go through checkout! :clap:

( actually 'submitted' the order and it all worked ... but then I had to call up my boss and tell her to disregard the email order notification ... :) )

My bos tried out the cart on her computer, and got the cookies message ... she's also using Win XP, and IE7.

So, I suspect my glitch has to do with Win XP... ??

If any of the kind members would care to try out my initial cart, it's at:

http://fruitlady.net/zencart/

You don't have to go all the way through checkout (unless you want to; I'll alert the boss to consider any 'orders' as testing...) .

I would be curious to know how other platforms function with my Zen Cart, and ensure that it is usable for all customers.

TbA

26 May 2011, 11:11 PM
#20
vger avatar

vger

Past Contributor

Join Date:
Nov 2004
Location:
Norfolk, United Kingdom
Posts:
3,189
Plugin Contributions:
0

Re: Someone stole my cookies!

I get as far as adding items to the Shopping Cart, clicking to go to Checkout and then going to the Login/Create Account page - and no problem up until there.

This is not a Zen Cart problem. I use Win XP as well - as do millions of other people.

Vger