Seems first_name is not in your session but $this->Session-
>read('User.username') must be in.
On Nov 13, 11:28 pm, Brian <[EMAIL PROTECTED]> wrote:
> From within my controller if I print the entire session:
> $this->Session->read()
> It returns:
> Array ( [Config] => Array ( [userAgent] =>
> cbc2e74d1e45abcccfdc85ca016f6426 [time] => 1194988565 [rand] =>
> 1309992527 ) [User] => Array ( [id] => 1 [username] => brehg
> [password] => DEB8ABLE [email] => [EMAIL PROTECTED] [first_name]
> =>
> Brian [last_name] => Rehg ) )
>
> If I try try to print the last_name:
>
> $first_name = $this->Session->read('User.first_name');
> echo "FIRST NAME: " . $first_name;
>
> echo "FIRST NAME: " . $this->Session->read("User.first_name");
>
> print_r($this->Session->read('User.first_name'));
>
> they all return nothing.
>
> On Nov 13, 4:06 pm, "Christopher E. Franklin, Sr."
>
> <[EMAIL PROTECTED]> wrote:
> > Whoops! I was wrong, you can access it via
> > $this->Session->read('User.first_name'); because the read function uses
> > Set::extract
>
> > to get the value out.
>
> > On Nov 13, 1:05 pm, Brian <[EMAIL PROTECTED]> wrote:
>
> > > >From within my controller if I print the entire session:
>
> > > $this->Session->read()
> > > It returns:
> > > Array ( [Config] => Array ( [userAgent] =>
> > > cbc2e74d1e45abcccfdc85ca016f6426 [time] => 1194988565 [rand] =>
> > > 1309992527 ) [User] => Array ( [id] => 1 [username] => brehg
> > > [password] => DEB8ABLE [email] => [EMAIL PROTECTED] [first_name] =>
> > > Brian [last_name] => Rehg ) )
>
> > > If I try to print an element within the array:
> > > $this->Session->read('first_name');
> > > returns:
> > > nothing
>
> > > What am i doing wrong- Hide quoted text -
>
> > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---