I've been working on an external PHP site that needs to interact with Moodle. I need some guidance on how to retrieve Moodle session variables within my external site. I've heard that it's possible to access these variables using PHP, but I'm not sure how to go about it.
To give you some context, I have a Moodle installation where users log in and have session variables set. Now, I want to build a separate PHP site that can access these Moodle session variables to provide customized functionality to the users.
I've searched online for solutions, but the information I've found is quite scattered and unclear. Some suggest using the `$_SESSION` variable in PHP, but I'm not sure if that applies to externally hosted sites as well.
So, my question is: How can I retrieve Moodle session variables in my external PHP site? Is it possible to do so using the `$_SESSION` variable, or is there another method that I should be using?
I would greatly appreciate any insights or examples from those who have dealt with a similar situation before. Thanks in advance for your help!