Question

I am developing a Google Marketplace App. I am using PHP.

I am trying to have an access point to my app which doesn't require the user to have logged into my app (or possibly even Google Apps for that matter), and then once they have submitted the entry point (which just consists of a string) that string is carried through the authentication process so that when they authenticated my app can process that string just as if they had been logged in.

Basically I have a HTML form which is like a cut down version of my app (which can be embedded on a website using an iFrame for example), and when the user fills it out it does an AJAX call to an API in my app which does require authentication, so the authentication process begins, but once it has finished it has lost the original data.

Does anyone know a solution to this?

Was it helpful?

Solution 2

I ended up using sessions however it was more tricky than usual because the authentication occurs on a different domain to the access point to the app. What I ended up doing was encoding $_SESSION and storing it in a database, and then when the authentication has occured and the app is logged in it checks the database for any sessions and restores them.

OTHER TIPS

I am not sure that you need to use Sessions for this - might be overkill. I am not sure the exact specifics of your application, but you might be able to place the data in the $GLOBALS superglobal. Take a look at the documentation: php.net/manual/en/reserved.variables.globals.php

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top