Re: Mixing Direct Actions and maintaining session state
Re: Mixing Direct Actions and maintaining session state
- Subject: Re: Mixing Direct Actions and maintaining session state
- From: Karl Gretton <email@hidden>
- Date: Wed, 05 Nov 2003 17:40:30 -0500
Thanks....I think that the WOHyperlink may not have been used. I will
give this a try.
It worked with the cookie anyway....I just hoped that there would be a
simple way to do it with a URL only...
..and there is! How typical of WebObjects to have something that just
does it with no effort!
Karl
On Nov 5, 2003, at 12:59 PM, email@hidden wrote:
On Wed, 05 Nov 2003 05:59:37 -0500 Karl Gretton wrote:
Using URL-based session state, the session context is lost when moving
between DirectAction pages and regular WO pages.
This is not supposed to be so. A direct action URL _can_ have a
sessionID in the URL. It appears as a key/value on the end of the URL,
like: "?wosid=[sessionID]". "wosid" is the key. If you generate a
DirectAction URL from WOHyperlink, WOHyperlink should automatically
append this if and only if a session is present (if it's not, it's a
bug,
but one you can work around manually if you need to). If you are
generating your DA URLs in some other way, it's easy enough to write
code
which appends this value on the URL if and only if there is a session
(hint: context().hasSession() will check if a session already exists).
So either of the options you identify is possible and supported by
Apple.
Option #2 ("Pass the sessionID in the URL between DirectAction pages,
but
don't require it") is supposed to be automatically done for you by WO.
Option 1, putting the sessionID in cookies, will also work. Either
way,
whether the sessionID is in a cookie set up according to WO
conventions,
or in the URL according to WO conventions, the DirectAction pages
should
pick it up if it's present (and them pass it on to generated URLs), and
not mind if it's not present. It ought to basically just work, just
the
way you've described it.
--Jonathan
What solutions have people found to this? We have two ideas and would
like to have other peoples comments on them:-
1) Force WO to use a cookie for maintaining session state. While the
DirectAction pages will ignore this (will they? or is there someway to
still get at the session even though this is a DirectAction?) the
session should be preserved when the user selects a link to a regular
session-based WO page.
2) Pass the user's session ID around in the URL between DirectAction
pages but don't require them. Therefore, the DA pages will still work
for people without a session and of someone bookmarks the page,
somehow
the DA page can ignore the session and/or pass the session information
to regular pages/
Any other ideas or comments?
Karl
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.