![Picture of Vincent Picture of Vincent](/picture/user/1119939.png)
Vincent - 2016-02-13 19:24:13
Hi,
I need some advice on handling data before and after getting OAuth credentials from Twitter. I'd like to store OAuth credentials in a MySQL database. I'm using mysqli_login_with_twitter.php. This works excellent when setting a fixed number for users ($client->SetUser(1)). I wish to set the user ID manually.
My web application works as follows:
Users login on my application. After login, the application searches the database for the user ID. This ID should be temporary stored for use after Twitter authentication. When there are no Twitter OAuth settings available, the user is sent to Twitter to connect. After the user accepts the connection, Twitter sends the user back to my application. From that moment I need the user ID to set in $client->SetUser(###).
I tried using $_SESSION without any result. It seems all sessions are destroyed when the user returns.
Can you give me some advice how to store the user ID?
Thank you in advance for your response.