Zen Cart Logo
Forums / General Questions / Message when cookies are disabled?

Message when cookies are disabled?

Locked

Views: 3,758

Results 1 to 17 of 17
This thread is locked. New replies are disabled.
6 Oct 2010, 1:34 PM
#1
orange_juice avatar

orange_juice

Zen Follower

Join Date:
Apr 2009
Location:
Athens, Europe
Posts:
125
Plugin Contributions:
0

Message when cookies are disabled?

Hallo,

When a browser does not accept cookies, I have a problem ...

Firefox issues the following message:

The page isn't redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

  • This problem can sometimes be caused by disabling or refusing to accept cookies.

Internet explorer ( :censored: ) is indefinitely trying to do what it was asked, probably loading the server with unnecessary traffic. (Zen cart sends a cookie, explorer blocks it, zen cart sends another one, explorer blocks it ... for ever)

Is it possible to have zen cart check if cookies are disabled, and -if so- cease any activity and inform the user that he must enable cookies?

Kind regards,
orange_juice

7 Oct 2010, 3:00 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: Message when cookies are disabled?

Sounds like you've got an addon installed or server configuration problem that's breaking normal operation.

7 Oct 2010, 4:42 PM
#3
orange_juice avatar

orange_juice

Zen Follower

Join Date:
Apr 2009
Location:
Athens, Europe
Posts:
125
Plugin Contributions:
0

Re: Message when cookies are disabled?

Indeed ...

Thank you for your prompt reply.

My cart's behavior is rather different that the original zen-cart in this issue.

I will try to find out where the problem lies.

However, I would very much like to prevent people from navigating in the site unless cookies are enabled.

Would this be possible?

Kind regards,
orange_juice

7 Oct 2010, 4:52 PM
#4
drbyte avatar

drbyte

Sensei

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

Re: Message when cookies are disabled?

Your time will be better sent figuring out what's causing the unnecessary redirects.

7 Oct 2010, 4:55 PM
#5
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Message when cookies are disabled?

orange_juice:

inform the user that he must enable cookies?

Sorry, I don't know the technical answer to your question (though Googling force cookie use might provide some answers), but if I have cookies disabled, I've done so for a reason, and I'd leave your site before I'd let you dictate how I operate my browser. Just my $.02 worth.

7 Oct 2010, 7:33 PM
#6
orange_juice avatar

orange_juice

Zen Follower

Join Date:
Apr 2009
Location:
Athens, Europe
Posts:
125
Plugin Contributions:
0

Re: Message when cookies are disabled?

DrByte:

Your time will be better sent figuring out what's causing the unnecessary redirects.

Thanx, this is the proper thing to do.

The issue should be lying at my host's configuration, because he uses lighttpd. Along with Simple SEO url those redirects initiate.

I am currently talking through this issue with them.

stevesh:

Sorry, I don't know the technical answer to your question (though Googling force cookie use might provide some answers), but if I have cookies disabled, I've done so for a reason, and I'd leave your site before I'd let you dictate how I operate my browser. Just my $.02 worth.

Opinion respected. I apologize for the wording. At my second post, I made it better:

However, I would very much like to prevent people from navigating in the site unless cookies are enabled.

Nevertheless, I will try to cater for all users. This is the best, I agree. :hug:

Kind regards,
orange_juice

9 Oct 2010, 3:18 PM
#7
orange_juice avatar

orange_juice

Zen Follower

Join Date:
Apr 2009
Location:
Athens, Europe
Posts:
125
Plugin Contributions:
0

Re: Message when cookies are disabled?

The issue of the redirects is solved now.

It was caused by the default value of php for session.use_only_cookies which has changed from 0 to 1 at version 5.3.

Kind regards,
orange_juice

9 Oct 2010, 5:22 PM
#9
drbyte avatar

drbyte

Sensei

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

Re: Message when cookies are disabled?

My server has session.use_only_cookies set to 1 and it works fine for me. I can browse the store, login, add items to my cart, complete checkout.

9 Oct 2010, 9:26 PM
#10
orange_juice avatar

orange_juice

Zen Follower

Join Date:
Apr 2009
Location:
Athens, Europe
Posts:
125
Plugin Contributions:
0

Re: Message when cookies are disabled?

DrByte:

My server has session.use_only_cookies set to 1 and it works fine for me. I can browse the store, login, add items to my cart, complete checkout.

How is this possible? Is there a special setting I have to make at the admin menu or the server?

I have just installed a fresh zen-cart 1.3.9g with a demo store and I am trying to navigate with mozilla-firefox-3.6.9 in a linux gentoo environment.

As expected, I get a ?zenid= ... at the end of my url.
However, this number changes constantly after each click I make.

Therefore, when I send something to the shopping cart, although I have a zenid number, I get a message "your shopping cart is empty" because the shopping cart's zenid is different than the one I had at the product's page.

Combining this constant ?zenid number change, with the simple SEO url, we get infinite redirects.

However, when I disable the session.use_only_cookies by setting it to 0, everything works like a charm.

:dontgetit

Kind regards,
orange_juice

11 Oct 2010, 9:07 AM
#11
drbyte avatar

drbyte

Sensei

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

Re: Message when cookies are disabled?

Apparently your server is configured in such a way as to not properly set up sessions, thus pushing an invalid value into the session cookie, which then doesn't match what the server is expecting, which then forces it to put the zenid into the URL, which then your URL rewriting rules are turning into redirects.

11 Oct 2010, 10:38 AM
#12
orange_juice avatar

orange_juice

Zen Follower

Join Date:
Apr 2009
Location:
Athens, Europe
Posts:
125
Plugin Contributions:
0

Re: Message when cookies are disabled?

When cookies are enabled:

Everything works fine.

When cookies are disabled and session.use_only_cookies=0:

Everything works fine.

When cookies are disabled and session.use_only_cookies=1:

The ?zenid number changes in the url after each click.
This happens at my home server, at my host's lighttpd server and at my host's apache - 2 server.

session.use_only_cookies=1 by default at php 5.3

session.use_only_cookies specifies whether the module will only use cookies to store the session id on the client side. Enabling this setting prevents attacks involved passing session ids in URLs. This setting was added in PHP 4.3.0. Defaults to 1 (enabled) since PHP 5.3.0.

Kind regards,
orange_juice

11 Oct 2010, 11:00 AM
#13
drbyte avatar

drbyte

Sensei

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

Re: Message when cookies are disabled?

orange_juice:

When cookies are enabled:

Everything works fine.As expected.
orange_juice:

When cookies are disabled and session.use_only_cookies=0:

Everything works fine.As expected.> orange_juice:

When cookies are disabled and session.use_only_cookies=1:

The ?zenid number changes in the url after each click.As expected.

11 Oct 2010, 11:21 AM
#14
orange_juice avatar

orange_juice

Zen Follower

Join Date:
Apr 2009
Location:
Athens, Europe
Posts:
125
Plugin Contributions:
0

Re: Message when cookies are disabled?

Thank you!

This trend seems to imply that it is more secure for both the server and the client to accept the session cookie of zen-cart and set the browser to automatically delete it after the browser is closed, than to reject cookies and allow the session to be appended at the url.

Therefore, I think the Configuration -> Sessions -> "Force Cookie" = true setting, is closer to what Google - Yahoo and other major websites with robust privacy policies accept as a sound and effective security measure.

Kind regards,
orange_juice

13 Oct 2010, 8:35 AM
#15
orange_juice avatar

orange_juice

Zen Follower

Join Date:
Apr 2009
Location:
Athens, Europe
Posts:
125
Plugin Contributions:
0

Re: Message when cookies are disabled?

Hallo again!

I saw that when I set Force Cookie = true, a cookie named "cookie_test" is sent from my store which expires after one month.

Would it cause any technical issue if I set this cookie to expire at the end of the session?

Thank you for your help.

Kind regards,
orange_juice

13 Oct 2010, 9:04 AM
#16
drbyte avatar

drbyte

Sensei

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

Re: Message when cookies are disabled?

It won't cause any technical issue. What specific reason do you have for wanting to change it?

13 Oct 2010, 9:19 AM
#17
orange_juice avatar

orange_juice

Zen Follower

Join Date:
Apr 2009
Location:
Athens, Europe
Posts:
125
Plugin Contributions:
0

Re: Message when cookies are disabled?

Thank you for your prompt answer.

My thought is the following:

I have set Force cookies = true and when someone with disabled cookies tries to log in or place something in his basket a message appears that notifies him of this policy.

Since I "oblige" users to accept cookies, I would like to inform them of which cookies are stored into their computer from my site.

There are two: cookie_test and zenid.

zenid expires at the end of the session. I consider very nice and discreet to have cookie_test to expire at the end of the session too.

This way, even the most sensitive user about cookies will feel that "I entered that store, they informed me that they make the most to keep my visit safe without collecting any personal data in cookies, and when I exited it was like I never entered because nothing was left in my hard disk."

Kind regards,
orange_juice