(06-23-2021, 03:26 AM)craig Wrote: Every single page view in a PHP web application is an entirely new instance of the code execution - all the init() and construct() functions will get called. At the end of the script execution (e.g. viewing a page), the classes and variables are destroyed. PHP apps work entirely different to C programs, so that knowledge doesn't transfer exactly.
For your use case, you could move your function call to get_from_locker() to your login handling code, after verifying their password - so you only do it once you have a valid user. Then you don't need to call it again anywhere, and you don't need to do it in any init() or construct() calls.
If you do insist on doing it in those places, then use Sessions to keep track of whether or not you've got the image.
ThanksĀ so much to all of you. OK, now things are a little clearer. I need to investigate but the way it works now is I have a separate controller that handles the login and then dumps the user in my dashboard. I am changing this to use fusionAuth so I can have them "dumped into" a specific function. I have been battling with fusionAuth's passwordless login for a few months and am just about to give up on that feature.
proof that an old dog can learn new tricks