Here is how i am writing the session variables.
if(($user = $this->User->validateLogin($this->data['User'])) == true) {
$this->Session->write('User', $user);
$this->Session->setFlash('You\'ve successfully logged in.');
$this->redirect('/');
}
The function validateLogin is as(please ignore typos etc.. all that is
working fine):
$user = $this->find(array('email_address' => $data['email_address'],
'password' => 'password']), array('id', 'email_address'));
if(empty($user) == false)
return $user['User'];
return false;
Here is how I read the session.. in the other controller ..
if ($this->Session->check('User')) {
$this->log('Got the user');
}
else {
$this->log('No Session Yet');
}
Thanks.
On Mon, Mar 3, 2008 at 9:43 PM, Novice Programmer <[EMAIL PROTECTED]>
wrote:
> Hello,
>
> using activate does not resolve the issue and i dont know that why i would
> need to call activate since activate is a turned on in core.php. Any other
> suggestions?
>
> Thanks.
>
>
> On Mon, Mar 3, 2008 at 9:43 AM, abiram <[EMAIL PROTECTED]> wrote:
>
> >
> > Hai u use session->activate function
> > also see
> > http://groups.google.co.in/group/cake-php/browse_thread/thread/75946ff8f12cd51e/78961c398cc3621a?hl=en#78961c398cc3621a
> >
> > On Mar 3, 2:58 am, "Novice Programmer" <[EMAIL PROTECTED]>
> > wrote:
> > > Hello,
> > >
> > > I am facing session problems on redirection. The function
> > session->read()
> > > returns nothing on the session stored before redirection. I searched
> > on the
> > > google and found some solutions one of them was modifying htaccess
> > which i
> > > can't do because of shared host. Another was to put session id in url
> > which
> > > is not secure enough. Was wondering on how other people handle this
> > problem.
> > > Please help.
> > >
> > > --
> > > Thanks & Regards,
> > > Novice (http://ishuonweb.wordpress.com/).
> > > >
> >
>
>
> --
> Thanks & Regards,
> Novice (http://ishuonweb.wordpress.com/).
>
--
Thanks & Regards,
Novice (http://ishuonweb.wordpress.com/).
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---