Monday, May 25, 2009

Re: cookie stays empty on production server

check yours cookie configuration

$this->Cookie->path = '/';
$this->Cookie->domain = 'domain.com';



On Mon, May 25, 2009 at 7:07 AM, CheshirePuss (via Nabble) <ml-user%2B202185-126257907@...> wrote:

I'm trying to implement a voting system, and I want to use a cookie to
store the items that the current user already voted for, thus going
against multiple voting.

function vote($dir,$id,$type)
{
$votes = $this->Cookie->read('votes');
/*process data, adding or subtracting id's and stuff from the array
$votes*/
$this->Cookie->write('votes', $votes);
}

in appcontroller:
var $components = array('Cookie');

and this works when I use it on my local WAMP testing server.
But when I upload it to m production server, $votes stays empty, even
though, when I check my cookies, a cookie was made for every item
voted for.
I have no idea what causes this, does anyone else?





View this message in context: Re: cookie stays empty on production server
Sent from the CakePHP mailing list archive at Nabble.com.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: