So I have a user login system. The login works.
What I want to do is make a variable array in the class available for general usage. Obviously in most cases set the data in the constructor.
My login / user class has the login stuff within it, as well as the user functions. In this class I have {bool LoggedIn()} that I use for login status verification. So the class could very well be constructed and the user isn't logged in.
So I make the constructor a login verification? Or keep the method? Or both? Use the method within the constructor ( if thats possible ) to login verify then set the details?
Not sure which is the best, and most efficient way.
What I want to do is make a variable array in the class available for general usage. Obviously in most cases set the data in the constructor.
My login / user class has the login stuff within it, as well as the user functions. In this class I have {bool LoggedIn()} that I use for login status verification. So the class could very well be constructed and the user isn't logged in.
So I make the constructor a login verification? Or keep the method? Or both? Use the method within the constructor ( if thats possible ) to login verify then set the details?
Not sure which is the best, and most efficient way.
Comment