marek
marek

Reputation: 279

php sessions and mobile applications

I'm developing application that would communicate with a mobile app. My problem is as follows - my mobile app doesn't accept any session data - no $_GET variables, no cookies - all communication in both sides is done with xml and I can't change it by, for example adding some parameters to xml, because mobile app would not understand those. Now, I would like to use php sessions - mobile app sends me a unique identifier which I can use as a session key. Will this work in an usual manner, like setting some variable in $_SESSION array, and then retrieving them in next request?

ps. I can't use database nor files...

Upvotes: 1

Views: 3063

Answers (1)

Femi
Femi

Reputation: 64700

You can use the session_id() function to fetch the PHP session ID and somehow include that in the XML you send to the device, and then at the other end you can extract the unique identifier, call session_id({unique_parameter}); to set the session ID and then call session_start(); and you should be all set.

Upvotes: 2

Related Questions