Using Session Variable and Cookies with Phonegap on iPhone and Android

I am having problems getting PHP session variables (for example, $ _SESSION ['username']) to work with PHP server-side code launched via an ajax call from the Phonegap application.

In exploring this issue, I found conflicting recommendations as to whether session variables and cookies can be used.

Does anyone have a definitive answer?

If you can use session variables and cookies, are there any issues that I should know about using them that could help them not work?

I know that cookies can be enabled for Phonegap applications on the iPhone, but as far as I know, not for Android.

+6
source share
1 answer

You would be better off transferring the data that you usually stored in session variables to your PhoneGap application via JSON and have an application that will store it that way.

Think about how to use an external API. The application will authenticate and return a token. It will save this token and will verify the authenticity of further requests to the server.

+2
source

Source: https://habr.com/ru/post/893869/


All Articles