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

Storing user phlq result row in session for member login

Hello,

Last project I store member database object in session. It was very useful. When member data needs update (which in my case a lot) it was suberbly easy.

Is there any problem about this ? Em I missing someting ?

My Best Regards



43.9k

Hi,

what is exactly your problem ?

From controller:

$this->session->set('user',$result)

Whats your problem ?



11.9k

Hello, thanks for reply. I use it without any problem however I do not know is there anything against ? Is it a good practice ?



145.0k
Accepted
answer

Its fine practice - you dont have to select user again. But you have to remember updating it. Maybe implement some behaviour in user class ? That will check if updated user id is user id from session it will reset it ?