[flexcoders] Re: logout user after cookie expires (state change)
Any chance it's possible without using AJAX? --- In flexcoders@yahoogroups.com, Duke, Alfred W [YOH Contractor for Sprint] [EMAIL PROTECTED] wrote: Tanya, You can all of this using AJAX with flex From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of TCash21 Sent: Monday, March 19, 2007 11:24 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] logout user after cookie expires (state change) Hi all, I'm using PHP + Flex, and I'm pretty new to using sessions and session data. I've figured out how to create a cookie, make it expire, etc... I need to check the session ID with every HTTPService request, and if it's not valid, log the user out (make a state change in Flex). Also, if the cookie expires, I need the user to be logged out. Does anyone know how I can check this and trigger a state change (to logged out state)? Thanks
[flexcoders] Re: logout user after cookie expires (state change)
I've been having trouble getting AJAX and Flex to work... I've followed the readme exactly, I can get the few methods available from FABridge, but I keep getting this error: Access of possibly undefined property flash through a reference with static type Class it's coming from this line public function useBridge():void { var flexApp = FABridge.flash.root(); } --- In flexcoders@yahoogroups.com, TCash21 [EMAIL PROTECTED] wrote: Any chance it's possible without using AJAX? --- In flexcoders@yahoogroups.com, Duke, Alfred W [YOH Contractor for Sprint] alfred.w.duke@ wrote: Tanya, You can all of this using AJAX with flex From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of TCash21 Sent: Monday, March 19, 2007 11:24 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] logout user after cookie expires (state change) Hi all, I'm using PHP + Flex, and I'm pretty new to using sessions and session data. I've figured out how to create a cookie, make it expire, etc... I need to check the session ID with every HTTPService request, and if it's not valid, log the user out (make a state change in Flex). Also, if the cookie expires, I need the user to be logged out. Does anyone know how I can check this and trigger a state change (to logged out state)? Thanks
[flexcoders] Re: logout user after cookie expires (state change)
I suggest letting the server tell you if the session has expired. You are sending the cookie anyway either in the request header or in the url. If the server always returns a status node with code and severity, you can check the value of severity (0=success, 1=warning, 2=error, 3=fatal) and act upon the specifed code (e.g. dialog the user, modify the cookie, dispatch a sessionHasEnded event.) Use the severity to determine error or success and use the code to determine the behavior and to localize the dialog message**) At the company I work for, our messages are actually soap and sessions are based on SAML so they're a just little more complicated than the samples below, but these illustrate it better anyway. REST Request : http://helloworld.com/getWallet?id=[cookie-value] Good response Response Header Status code=wallet_servlet.success severity=0 message=* / Session id=[some-new-cookie-value || original-cookie]/ /Header Body !-- Empty Wallet --Wallet/ /Body /Response Bad Response: Response Header Status code=wallet.session_error severity=1 message=* / Session id=/ Header Body/ /Envelope * I could generate some Lorem ipsum dolor for the message but a simple message is good for wap clients etc that have room for localization messages. ** In your localization file you can say something like wallet.session_error=You must be logged in to do that.