Re: Webobjects, Flex and Sessions
Re: Webobjects, Flex and Sessions
- Subject: Re: Webobjects, Flex and Sessions
- From: David LeBer <email@hidden>
- Date: Mon, 10 Mar 2008 10:15:33 -0400
On 10-Mar-08, at 9:07 AM, Thierry Kramis wrote:
Hi all
I'm completely new to using Webobjects with Direct Action. Earlier
I've implemented custom actions. Now I would like to use Flex as
frontend. I'd like to call direct actions in between the two to pass
the data around instead of using soap.
My idea was to invoke a login action getting a session id back to
flex which then is passed alongside every further request to use any
other actions. As soon as that session expires the client app
wouldn't be able to do further requests.
It's unclear to me how to realise such a behaviour.
Can anyone help?
What are you having a problem with?
Generating a session in the login DA is easy: Just call session();
To get its ID just call: session().sessionID();
If no session currently exists a new one will be generated.
Reusing the session is equally easy:
Append the sessionID to the url of the DA you are calling:
http://www.theapp.com/cgi-bin/WebObjects/wa/action?wosid=THESESSIONIDSTRING
The session will be restored automatically.
Alternately, if you embed the sessionID in some returning XML you can
restore a session with:
session = (Session)
(Application.application()).restoreSessionWithID(theSessionID,
context());
;david
--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site: http://codeferous.com
blog: http://davidleber.net
profile: http://www.linkedin.com/in/davidleber
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden