Textpattern Forum

You are not logged in. Register | Login | Help

#1 2012-06-11 12:08:28

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 4,824
Website

Check if browser accepts cookies

Is there a way to check if a browser accepts cookies and if it does not to show a message?

I was thinking something like the js <noscript> tag for cookies would be very handy for many sites.


Yiannis
——————————
neme.org | neme-imca.org | hblack.net | LABS

Offline

#2 2012-06-11 12:22:43

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 4,824
Website

Re: Check if browser accepts cookies


Yiannis
——————————
neme.org | neme-imca.org | hblack.net | LABS

Offline

#3 2012-06-11 13:45:40

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 1,893
Website

Re: Check if browser accepts cookies

colak wrote:

Solved

Kind of. It solves whether a user has given permission for a site to use cookies, not whether the browser has cookies switched off.


TXP Builders – finely-crafted code, design and txp

Offline

#4 2012-06-11 14:06:16

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 4,824
Website

Re: Check if browser accepts cookies

Oops,
Thanks Jakob I should go for this one then.


Yiannis
——————————
neme.org | neme-imca.org | hblack.net | LABS

Offline

#5 2012-06-11 16:28:06

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 4,824
Website

Re: Check if browser accepts cookies

I actually did not notice the discussion here which is very much related. Stupid or not, the law is out there and ignoring it will not make it go away… Unfortunately.

I understand that txp only uses 2 types of cookies

  • To remember the login/password to the admin side
  • To remember commenter’s details

Both have a tick box to ask for permission so I guess they comply with the law (as it is in the UK anyway).

Plugins is another matter though. A recent post initiated by zero, led to a solution reliant on cookies set by plugins whereas most of us use stats programs such as google analytics, slimstat, awstats, etc which again require cookies.

My short research revealed that there are two methods (possibly compatible with txp) to ask for those permissions and abide to the EU law.

  1. Javascript
  2. php

IMHO the javascript solution is not robust enough as some people surf with js disabled.

The 2 php solutions i found here and here are again not satisfactory.

The first blocks the site if cookies are not accepted and the second only checks if cookies are accepted and prints messages accordingly. I guess that as most of our devs reside in Europe, it would be good if a preference could be added to the CMS to include the following:

  • an option not to save IP addresses in the logs (to satisfy German laws)
  • a way to not obtrusively ask permission to use cookies without blocking the site if the user opts not to with their preference saved (or can it? as this would require a cookie:)

I have no idea how hard it is to implement the above and although I do agree that the law is totally ignorant of how the net works I still think that the option should be there as the law’s intention to protect privacy is indeed a good one.


Yiannis
——————————
neme.org | neme-imca.org | hblack.net | LABS

Offline

Board footer

Powered by FluxBB