Re: restore an existing session w/ a DA
Re: restore an existing session w/ a DA
- Subject: Re: restore an existing session w/ a DA
- From: Nathan Dumar <email@hidden>
- Date: Wed, 13 Jul 2005 22:26:15 -0400
Oops ... and Chuck, thank you for the warning.
On Jul 13, 2005, at 10:22 PM, Nathan Dumar wrote:
It's not quite working the way I hoped it would.
I also became a little wary of my initial idea of picking up an
existing session from Chuck's warning.
After thinking about it some more, I realized I could accomplish my
original intent in a more straightforward manner with a mutable array
at the Application level. And it would sure be a whole lot easier
than writing a bunch of code to save the entries to the db and
periodically clean up the database of unused entries, which is what I
was avoiding. ... Hmm, and I could also put the session id in that
array so that I can terminate the old sessions right away. And the
mutable array would be flushed every night with the usual restart.
Nice.
Ute and Galen, thank you for your help anyway.
Nathan
On Jul 12, 2005, at 8:38 AM, Galen Rhodes wrote:
I don't know if this is what you're trying to accomplish, but I would
just use the WOSID parameter and then call the session() method.
"WOSID" is a recognized parameter by WebObjects. If the session with
that ID exists then it's returned by the session() method and if it's
not then a new one is created.
For example, you would create a DA URL like so:
http://.../wa/verify?wosid=<sessionID>&k=<randomNumber>
Then your DA would look like so:
public WOActionResults verifyAction() {
Session session = (Session)session();
/* Do any processing on the session here. */
}
See if that works for you.
On Jul 11, 2005, at 5:07 PM, Chuck Hill wrote:
Don't do this. Write to the DB. At best you will have two
different sessions checked out for the same request. I don't think
that will have happy results for your application.
Chuck
On Jul 11, 2005, at 1:59 PM, Nathan Dumar wrote:
I think that WOSessionStore.checkOutSessionWithID() is the method
that I need to use, but I could be wrong.
If it is, then I need help understanding the second argument,
"WORequest aRequest."
I'm making a method where I verify that an email address exists and
is correct before I continue with a registration process. In the
email, I'd like to have a link that runs a direct action which
includes the current session ID and a random number to match. For
example:
http:// ... /verify?s=<sessionID>&k=<randomNumber>
Typically, the DA would create a new session, but I would like it
to use the session ID from the URL, so that I have the same
randomNumber in memory and don't need to insert/fetch from the db.
(This gives my users a 2 hour time limit before session timeout,
but I'm okay with that.) I know how to get values from the URL ...
what I can't figure out is how to use an existing session instead
of making a new one. This is where I think I need
WOSessionStore.checkOutSessionWithID().
How can I do this?
(I'm assuming, perhaps wrongly, that restoration of the session
will result in the page the user was just in, as if it was always
there, including values in the variables just as they were.)
Thanks for any help or direction,
Nathan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
--
Practical WebObjects - a book for intermediate WebObjects developers
who want to increase their overall knowledge of WebObjects, or those
who are trying to solve specific application development problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
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