I'm currently working on a PHP project with MySQL, and I'm running into an issue with a PHP SESSION variable. Whenever I try to access it, I keep getting an "undefined variable" error. I've searched online for a solution, but I can't seem to find anything that works for me.
Here's a bit of background on what I'm trying to achieve: I have a login system set up where users can log in and their session is saved. Once logged in, they are redirected to a dashboard page where their session data is displayed.
However, when I try to access the session variable using $_SESSION['variable_name'], it gives me the "undefined variable" error. I've made sure to include the session_start() function at the top of my PHP files, so I don't think that's the issue.
I'm wondering if there's something specific I need to do when working with MySQL and PHP sessions together. Perhaps there's a setting I need to configure or some additional code I need to add?
Has anyone else come across this issue before or have any ideas on how to resolve it? Any help would be greatly appreciated!
Thanks in advance for your assistance!