Thursday, December 24, 2009

Re: Cookie in Models

Pulling the client_id from the cookie in the model really isn't a good
idea IMO. The only way I can think of doing it is straight up with php's
basic cookie functions or doing something like
ClassRegistry::init('CookieComponent') and hoping it doesn't bomb out on
you.

OTOH you can easily get to the cookies in the controller and pass it in
to your model when it's needed.

On Thu, 2009-12-24 at 07:59 -0800, dyutiman wrote:
>
> Hi,
>
> I am building an application with multiple database. Database gets
> selected based upon clients. Now the client_id is saved in a cookie. I
> have to read the cookie value in my /app/app_model.php page to select
> respective database.
>
> Is there a way to retrieve the cookie value in that page !!!
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
>
> 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


Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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: