[eluser]TheFuzzy0ne[/eluser]
Hi everyone.
I'd like to create a library called "user", which will essentially be used to represent the current user in any given request, as well as logging them in and out. It will have a setter and getter that will set variables in the session class' userdata array. The class will be automatically initialized when it starts. It will check for a user id in the cookie on each request when it's instantiated, and it will refresh any existing session data with that from the database, so for example, if a user is banned from the site, the ban will take effect immediately, and log them out (hopefully this makes sense). Basically, it's a lot like an auth system.
It needs to make use of my user model and the session library, I'm just wondering what the best way might be to go about ensuring that the session library and my user model have been loaded first. Should I just load them both in the constructor? It seems like it might be the only option, but I just want to check I'm not missing something.
Thanks in advance. Comments welcome.