Air, Android, and cookies
What: In using an Android app, I need to send an authentication request (username/password) to the server and the server needs to send me back a cookie. We all know how you would use JavaScript to grab cookie/session data and then you could send it right into flash.
Problem: How or where would you find cookie being sent to you in your Air/Android app that uses no browser?
Solution: Headers can be found in the HTTPStatusEvent object! Hurray! It took me way too long to find the answer to this issue. Everyone on google is happy to tell you “Hey there’s a manageCookies setting on the URLRequest object!” Great, how do you find the damn headers? In fact, as you’ll see in the following code, you dont even need to mess with that manageCookies setting. I set it to true and got headers. I set it to false and god headers. I didn’t include it at all and got headers. Sweet.
(more…)