incubator-flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brett Adam <>
Subject Re: HTTPService persistant cookies in AIR
Date Wed, 25 Apr 2012 16:44:26 GMT
Take a look at my old blog posting on the evil things HTTPService does and how you can workaround
most of them. I do manage to send headers, btw.

Note that I have built a deeper hack-around that involves some nasty monkey-patching of the
layers underneath HTTPService  - although no outright code changes to any SDK classes. I'm
happy to share it if you're willing to hold your nose. 



On Apr 25, 2012, at 9:50 AM, David Coleman wrote:

> Hi List, I have a question about HTTPService, cookies and PHP sessions.
> I have years of experience with flex and PHP.  I'm using CakePHP which uses a combination
of cookies and session vars to maintain a login for the user.
> I have an AIR app, and I really don't want to use the URLLoader component (which does
properly allow me to set cookies), because it does not give me an AsyncToken.  I need the
AsyncToken to be able to manage my service stack due to requirements of my application.
> I do the following and it has NO effect whatsoever:
> var service:HTTPService = new HTTPService();
> service.headers = {Cookies:"foo=bar"};
> service.method = "POST";
> service.url = "localhost/foo/foo/foo";  // some url of some json service in my cake app
> service.send();
> (I don't need to send a payload because it uses url routing).
> I'm using the flex sdk 4.6.
> here are my problems:
> The cookies simply don't get to the server.  I've put a "var_dump($_COOKIES); die();"
in the first line of my index.php and nothing...The request reaches the server as a GET, which
I've found is a result of having an empty payload.
> I know that this list is more for questions on Apache Flex... but I'm curious, is this
a behavior that is fixed in Apache Flex?  Are there known workarounds in Adobe Flex 4.6? 
Is there something I'm doing wrong, or is it as everything I google suggests, that it is a
total failure of the HTTPService object to properly handle headers?
> Sincerely,David K. Coleman

View raw message