pabloruiz55
pabloruiz55

Reputation: 1306

Connecting to URL from iPhone and persisting php session

I have an iphone app that sends and retrieves data from a php script.

I would like to connect to that script once, save some data into a $_SESSION variable. Then on subsequent calls be able to retrieve the content of that $_SESSION vars.

Is this possible?

Thanks

Upvotes: 0

Views: 626

Answers (1)

Stefan Arentz
Stefan Arentz

Reputation: 34935

Yes, you will need to reuse the URLConnection to make multiple requests. Like for example one request to login and then one request to request data. The NSURLConnection will do the right thing and will keep track of cookies, which are the things that will keep your PHP session alive.

Upvotes: 3

Related Questions