Re: How do I use cookies in cakePHP
Hi, I also used Rossoft's cookie component as well. I also wanted to easily let users log in (no matter which page they enter on). So here's my attempt to make that happen: http://walkerhamilton.com/437/cakephp-remember-me --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
RE: How do I use cookies in cakePHP
Looking at your code, I would have to say that it is not recommended to add models at the AppController level. Your code is just asking to be made a component :) Something like app/controllers/components/remember_me.php: ?php class RememberMeComponent extends Object { var $components = array('Session', 'Cookie'); var $uses = array('User'); function remember() { if(!$this-Session-check('User') $this-Cookie-check('login')) { $cookie_arr = $this-cookie-read('login'); $someone = $this-User-findByEmail($cookie_arr[0]); if($someone['User']['password'] == $cookie_arr[1]) { $this-Session-write('User', $someone['User']); } } } } ? Then on your AppController you add RememberMe as a component, and on your beforeFilter() you do: $this-RememberMe-remember(); -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! -Mensaje original- De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de Walker Hamilton Enviado el: Lunes, 04 de Diciembre de 2006 01:22 p.m. Para: Cake PHP Asunto: Re: How do I use cookies in cakePHP Hi, I also used Rossoft's cookie component as well. I also wanted to easily let users log in (no matter which page they enter on). So here's my attempt to make that happen: http://walkerhamilton.com/437/cakephp-remember-me --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How do I use cookies in cakePHP
Whoa. Okay, why didn't I notice that before! That's freaking awesome and what I should have done in the first place. :) thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: How do I use cookies in cakePHP
Okay, so I think I got it all up and running as a component, Mariano. Your way was much better, though I had to modifying your (i'm sure quickly written) code to get it to work, especially with the new lazy loading models. http://walkerhamilton.com/439/rememberme-component --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
RE: How do I use cookies in cakePHP
Glad you liked it. I'm sure you had to modify it, I just programmed it in outlook and don't have a debugging plugin for it ;) -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! -Mensaje original- De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de Walker Hamilton Enviado el: Lunes, 04 de Diciembre de 2006 04:43 p.m. Para: Cake PHP Asunto: Re: How do I use cookies in cakePHP Okay, so I think I got it all up and running as a component, Mariano. Your way was much better, though I had to modifying your (i'm sure quickly written) code to get it to work, especially with the new lazy loading models. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
How do I use cookies in cakePHP
Hi, I want to be able to use cookies in cakePHP, since there is no built in interface for setting cookies I use the standard php setcookie(). However, when I try to retrieve the cookie later, using $_COOKIE, I get an empty array, as if cake has wiped the cookie. How can I get around this? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
RE: How do I use cookies in cakePHP
Check this, it works for me (although I changad the code a little bit): http://rossoft.wordpress.com/2006/05/22/cookie-component/ -MI --- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! -Mensaje original- De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de [EMAIL PROTECTED] Enviado el: Domingo, 03 de Diciembre de 2006 09:46 a.m. Para: Cake PHP Asunto: How do I use cookies in cakePHP Hi, I want to be able to use cookies in cakePHP, since there is no built in interface for setting cookies I use the standard php setcookie(). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---