global variable is the simplest way to achieve your task.
However, if you want to go advanced, you can store the details of the logins in a small table in your database.
this table will have a row for each user.
it will store info like : username, log in time, module currently used and so on...