Thursday, October 30, 2008

Re: cookie tutorial

Awesome, should add that to the cakephp books

On Oct 28, 1:34 am, "mailtobohu...@gmail.com"
<mailtobohu...@gmail.com> wrote:
> i figured it out.
>
> it works if put the following lines in beforeFilter() of the
> controller (don't put it in app_controller.php)
>
> $this->Cookie->name = 'location';
>   $this->Cookie->time =  3600;  // or '1 hour'
>   $this->Cookie->path = '/';
>   $this->Cookie->domain = 'localhost';
>   $this->Cookie->secure = true;  //i.e. only sent if using secure
> HTTPS
>   $this->Cookie->key = 'qSI232qs*&sXOw!';
>
> On Oct 23, 11:44 pm, . <lun...@gmail.com> wrote:
>
> > Is there a cake ticket for this? Or a possible fix?
>
> > On Thu, Oct 23, 2008 at 2:47 AM, jamescowhen <jamescow...@gmail.com> wrote:
>
> > > I have the same issue, removing the domain seem to fix it, but that
> > > doesn't get at the root of the problem
>
> > > On Oct 21, 11:31 pm, . <lun...@gmail.com> wrote:
> > > > same here.. so you still are leaving out the domain variable?
>
> > > > On Tue, Oct 21, 2008 at 11:13 AM, Stinkbug <justink...@gmail.com> wrote:
>
> > > > > I had a problem with cookies a while back. Couldn't seem to reference
> > > > > them after I saved them. I know the docs say the domain variable is
> > > > > required, but as soon as removed it, everything started working as
> > > > > expected.
>
> > > > > On Oct 20, 1:27 am, . <lun...@gmail.com> wrote:
> > > > > > I don't think it is saving the cookie, because if i go to another
> > > page,
> > > > > > doing $this->Cookie->read('name') returns null... how do i persist
> > > the
> > > > > > cookie?
>
> > > > > > On Sun, Oct 19, 2008 at 11:25 PM, . <lun...@gmail.com> wrote:
> > > > > > >  $this->Cookie->name = 'location';
> > > > > > >   $this->Cookie->time =  3600;  // or '1 hour'
> > > > > > >   $this->Cookie->path = '/';
> > > > > > >   $this->Cookie->domain = 'localhost';
> > > > > > >   $this->Cookie->secure = true;  //i.e. only sent if using secure
> > > HTTPS
> > > > > > >   $this->Cookie->key = 'qSI232qs*&sXOw!';
>
> > > > > > >  $this->Cookie->write('name','Larry');
>
> > > > > > > if I do the above, where is the cookie "location" saved to? I did a
> > > > > search
> > > > > > > on my HDD but cannot find the file.
>
> > > > > > > On Sun, Oct 19, 2008 at 11:03 PM, Daniel Hofstetter <
> > > > > dhofs...@gmail.com>wrote:
>
> > > > > > >> Hi,
>
> > > > > > >> > is there any tutorial about cookie component for cakephp? i am
> > > > > having
> > > > > > >> > trouble using it.
>
> > > > > > >>http://book.cakephp.org/view/177/Cookies
>
> > > > > > >> Hope that helps!
>
> > > > > > >> --
> > > > > > >> Daniel Hofstetter
> > > > > > >>http://cakebaker.42dh.com-Hide quoted text -
>
> > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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: