We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Phalcon Session

I have a session that is created after the login proccess with the User object data load from the db.

$user = $this->uService->login(parent::getVar("email"), parent::getVar("pwd"));
$this->session->set(Constants::USER_LOGGED_SESSION, $user);

After the login is validated, I use the dispatcher to forward a request to another action in the same controller. So far so good. The problem starts if I click in another link and try to use the user data stored in the session.

When I do this I get the following php errors:

Notice: Trying to get property of non-object in /srv/www/htdocs/link2me/app/views/admin/editInfo.volt.php

After the second dispatch forward the data from user is lost and the object exist but all its properties are null. What am I doing wrong?

Thanks



43.9k

What kind of data is $user and what is in

/views/admin/editInfo.volt.php



4.0k

$user is a model that holds data from a person like email, address, city, birthday, etc... The data come from a db

And editInfo.volt.php is a form to let the user change it own data.



4.0k
Accepted
answer

I solved the problem.