Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Dreamer's avatar

Storing senisitve information in session

Is it a good idea to store users admin status on session like this:

session()->put('is_admin', true);

It would only be run once on login and then different parts of application could use it without additional queries. Is it insecure in some way?

0 likes
4 replies
tomopongrac's avatar

I dont think that is sensitive information it is only flag for admin ... password would be sensitive information

Dreamer's avatar

@tomi Well, maybe, yeah. But if it could be set to true in any way by non admin user, the mess would be beig.

Please or to participate in this conversation.