Set Dynamic Variable In Main/config.php

Set Dynamic variable in main/config.php

Dynamic language for each user.

When user login with system i want to set seession variable, this session variable will be used in main/config.php to set language variable.

How to do it? or is there another way to do it?

check this: