Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

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



31.2k

What kind of data is $user and what is in

/views/admin/editInfo.volt.php



2.6k

$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.



2.6k
Accepted
answer

I solved the problem.