I am using Ionic1 with AngularJS.
I asked a question a few days back to fix an issue I had with PHP session variables which will give a deeper look into what I have done in my code:
PHP $_SESSION variables not working in ionic/angularjs application
My Issue:
I was developing it on Android and now I am developing it for iOS. What I have done is ported my files over to a mac and created a new platform (iOS) via ionic/cordova commands for my app. Both the android and iOS version of my app uses the same code and points to the same set of server/PHP files.
On the android version, it seems to keep the PHPSESSID the same throughout, from logging in and going into different pages with HTTP requests but on the iPhone simulator on xCode it doesn't seem to. The PHPSESSID changes on each HTTP request.
An example:
In my login.js
I do a $_POST
request to validate login details. If correct, move $state
to menu.js
. In this file, I do 3 separate $_GET
requests to get data to be used in the app. When I inspect this when using an android emulator/browser it displays the set-cookie: PHPSESSID
and it is the same for all requests while on the iOS it has a different PHPSESSID per request.
I've looked through a few stackoverflow questions:
PHP cookie is not staying set in uiwebview
Keep losing php session cookie in UIWebView
Can I set the cookies to be used by a WKWebView?
But I don't quite understand the answers and I'm not even sure if the answer applies to mine.
How come the iOS emulator doesn't work even though it is using the same files as the android platform?