I'm creating a website and part of the development allows administrators to 'freeze' someone's account (this prevents them logging in). I've created the functionality to 'freeze' / 'unfreeze' and check if an account is frozen or not within a class (along with all the other 'user' related methods).
However, it occurs to me that if the user is already logged in when the admin freezes the account I need to boot them out. So I need to check on every page refresh if their ID is 'frozen' or not.
I wondered if there is a bigger overhead in instantiating a new class and then calling my isUserFrozen() method every page refresh than just putting a normal function in to check if the user is frozen or not? (i.e. does instantiating an object have a bigger resource overhead?).
Thanks