Hey there, I have a login function in which I had added some code to
write a users email to the session.

For some reason when I used this code:
        function login() {
                $this->set('error', false);
                //see if the user is already logged in
                /*if ($this->Session->read('Auth.User')) {
                        $this->Session->setFlash('You are logged in!');
                        $this->redirect('/', null, false);
                }       */
                if($this->data){
                        $this->Session->write('user.email', 
$this->data['User']['email']);
                }
        }

It wouldn't write the email to session (it does the check to see if
the user is logged in ok), but when I used the following, it did. I
don't understand, whats the difference? Can you only have one if
statement in the login function or something?

        /*function login(){
        $this->set('error', false);
        if($this->data){
                $this->Session->write('user.email', $this->data['User']
['email']);
                }
        }*/

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to