How do I load a game with a user already logged in?

0 favourites
  • 3 posts
From the Asset Store
20 high quality click sounds, ready to improve your game's UI instantly
  • I'm looking to build an app that resides inside an iframe on a larger webpage. I would like to handle user authentication on the larger webpage, and then pass the username/password to the Construct 2 app in the iframe when it loads.

    I was considering the following possibilities:

    1. Store the authentication information as a php session variable, then modify the Construct 2 index.html to become index.php and load the username and password as javascript variables.

    2. Pass the authentication information via a GET request to the Construct 2 index.html (renamed as index.php) and load the username and password as javascript variables.

    In either case, I need to somehow create a javascript variable that Construct 2 will recognize in-game.

    Any ideas? Can this even be done?

    Thanks for your help!

  • If its a php based backend, could you not simply do a get request with ajax to a php file residing on the same server, retrieving the currently logged in user and whatever else is needed ?

    If I am not mistaken, it would be the same session.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • lennaert,

    I think you are right. I'm not sure why I didn't think of that, but I will give it a shot.

    Thanks for the help!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)