How to change the attribute of the authenticated user and save it in user session in Yii 2?

After authorization attributes of the user stored in session.How to change some attributes of the user, so that when you switch between pages attribute is again not changed at the initial?
March 19th 20 at 08:35
1 answer
March 19th 20 at 08:37
Do not store in session?) Rather store the id and the password hash of the user or the time of last password change to drop the authorization if the administrator changed the password. And so it is best to take each time from DB, then always relevant data, a single query on the primary key I do not think that just such a big load will be if the project is really big, then that is another question.
Every time we can't take, the logic is that after logging in, the user chooses what position to use him. Ie one user can have multiple positions, and he needs to switch between them and keep it. - Retha.Monahan commented on March 19th 20 at 08:40
Good morning.
Use of cookies. - Elisha commented on March 19th 20 at 08:43

Find more questions by tags Yii