0

Hi Guys

I am currently setting up a cookie message to tell users of the site that cookies are being used (EU cookie law)

I have managed to get this working on all desktop browsers, however I am having issues with mobile device ie iPhone, iPad, Galaxy tab etc

I am using the following to set the cookie once the accept button has been pressed.

setcookie("acceptCookies","yes",time()+(86400*60),"/","domain.co.uk");

To detect if a cookie is set I am using

if(!isset($_COOKIE["acceptCookies"])) {
    echo('show cookie message');
}

Is anyone able to see if I have missed something so it works on mobile devices, I have checked the device and cookies are set to be accepted on the devices.

Thanks
Shuka

3
Contributors
2
Replies
5
Views
5 Years
Discussion Span
Last Post by diafol
1
setcookie("acceptCookies","yes",time()+(86400*60),'/',"example.com",false,false);

seems to work for me.

setcookie("acceptCookies","yes",time()+(86400*60),'/',"blacknun.diafol.org",false,false);

if(!isset($_COOKIE["acceptCookies"])) {
    echo('show cookie message');
}else{
        echo $_COOKIE['acceptCookies'];
}

Try your mobile to - 'blacknun.diafol.org/cookie.php' . Worked perfectly on my HTC.

I'll be deleting this shortly - so post back once you've tried it.

Edited by diafol

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.