Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cookies working in Flex but not in Air

I've got a flex app which I'm porting to air, the two apps are identical except for the root tag being WindowedApplication rather than Application.

The problem is that cookie/session based logins are working for the flex app in the browser but not for the air app. Reading the docs says that cookies are available for air and the URLRequest manageCookies is true by default.

So does anyone have any idea which this is not working in Air?

*************UPDATE*****************

I've investigated further and it turns out cookies are working in Air and are used for all subsequent requests after the login, but the cookie does not survive a shutdown of the application and the user is required to login again when they restart.

So Question 2, is this expected behaviour? If so I will look into storing the cookie info in EncrptedLocalStore or something.

*************UPDATE*****************

Cheers,

Chris

like image 382
ChrisInCambo Avatar asked Dec 11 '10 15:12

ChrisInCambo


1 Answers

"AIR picks up cookie settings from the operating system, and not the browser. It just happens though that some browsers also use the operating system settings / cookies."

http://help.adobe.com/en_US/air/reference/html/flash/net/URLRequest.html#manageCookies

http://prsync.com/adobe/more-on-sharing-http-cookies-with-air-applications-107386/

I've investigated further and it turns out cookies are working in Air and are used for all subsequent requests after the login, but the cookie does not survive a shutdown of the application and the user is required to login again when they restart.

So Question 2, is this expected behaviour? If so I will look into storing the cookie info in EncrptedLocalStore or something.

Yes go ahead with EncrptedLocalStore.

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/data/EncryptedLocalStore.html

Update

http://blogs.adobe.com/simplicity/2010/08/single-sign-on-and-http-cookies-in-air-applications.html

like image 160
Thalaivar Avatar answered Sep 28 '22 03:09

Thalaivar