User Authentication for PHP based LMS

We have implemented a PHP based LMS and all our GDevelop games are hosted in URL. We call the GDevelop game through an iframe inside the LMS.

Now we want to integrate data analytics of individual users based on LMS user login. How do we pass the user information to GDevelop on the load of the game? Is there a way to append user id to the URL on or before the game loads?

If there’s a way to pass the data through the url I’m unaware of it, but it should be possible to pull the data at the beginning of the game with a “GET” request “At the beginning of the scene” in the first scene.

It depends on how you store session token. In most cases, you store it in a cookie or in the session storage. In that case, you can access it via Javascript, and use it to determine the user id. You can also just store the user ID as cookie on log in.

This is assuming you can use javascriot, which I assume you probably do since you made a LMS in php, but maybe I missunderstood. In that case, you can use an endpoint of the LMS that returns the ID of the logged in user, and send a request to it via the networking events.