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

jwz104's avatar

Add variable to auth session

I want to add a variable to the auth session of an user. So when a user logs in I can set the variable to authenticated. I want to do this for Two factor authentication. I found this question of how I can do it. http://stackoverflow.com/questions/29190058/laravel-add-and-remove-auth-session-variables

But when a user logs in on another location so is logged in at two locations. Needs the variable to be the same at both locations?

0 likes
1 reply
sobhanattar's avatar

Can't you use database field for this purpose? In this way by logging in one location you can store many information and surely manage two-step verification. It'll have some overhead because of added connections but seems a viable option.

Please or to participate in this conversation.