httpRequest and Cookies ?

I’m not seeing “Set-Cookie” parameters in the response headers. I know for a fact they are being sent by the web server and all the other parameters are there.

Unless httpRequest is manipulating the actual request to prevent cookies I don’t see any reason why Cookies are not showing. Are they being stripped out by Corona?

Hi Joel,

Is this on the simulator or device? If i remember correctly the “Set-Cookie” parameter isn’t available on the simulator (or at least it wasn’t for me), but once i built it for device it appeared correctly. 

Hi TandG and thank you for your reply.

I forgot to mention that I have only tried this on the simulator so far. I assumed a high level protocol such as HTTP would not behave differently between a device and simulator, but I will try it on a real device too asap. Thanks for the heads up! :slight_smile:

I think TandG is right… Mac OSX (and iOS too I believe) handle the cookies / session persistence directly. The problem for me was on Android - it didn’t manage the sessions, so my app has to store and repeat the cookie back to the server. (Session cookies I’m talking about).

I believe the session cookie was passed through to the app on iOS (pretty sure it was), and my code still copies and sends it back on iOS (despite iOS managing the cookies - don’t know if it filters my app cookie copy, uses it in place of the original cookie, or what). So, you probably will see the cookie on iOS.

On Android, you should see the cookie passed through to your app, but the OS will not automatically echo the session cookie back (not at the time I wrote my code for cookies anyways). In that case, you need to recreate the session cookie in the header and pass it back with your request. That’s my two cents anyways.

Hi Joel,

Is this on the simulator or device? If i remember correctly the “Set-Cookie” parameter isn’t available on the simulator (or at least it wasn’t for me), but once i built it for device it appeared correctly. 

Hi TandG and thank you for your reply.

I forgot to mention that I have only tried this on the simulator so far. I assumed a high level protocol such as HTTP would not behave differently between a device and simulator, but I will try it on a real device too asap. Thanks for the heads up! :slight_smile:

I think TandG is right… Mac OSX (and iOS too I believe) handle the cookies / session persistence directly. The problem for me was on Android - it didn’t manage the sessions, so my app has to store and repeat the cookie back to the server. (Session cookies I’m talking about).

I believe the session cookie was passed through to the app on iOS (pretty sure it was), and my code still copies and sends it back on iOS (despite iOS managing the cookies - don’t know if it filters my app cookie copy, uses it in place of the original cookie, or what). So, you probably will see the cookie on iOS.

On Android, you should see the cookie passed through to your app, but the OS will not automatically echo the session cookie back (not at the time I wrote my code for cookies anyways). In that case, you need to recreate the session cookie in the header and pass it back with your request. That’s my two cents anyways.