Re: Question Regarding Session ID's and Cookies
Re: Question Regarding Session ID's and Cookies
- Subject: Re: Question Regarding Session ID's and Cookies
- From: Neil MacLennan <email@hidden>
- Date: Mon, 26 Jul 2004 01:07:53 +0100
> Is it possible for a client to be using an active session, leave the
site momentarily and when they return have the session restored.
Whilst I haven't done exactly what you're asking (I use SessionIDs in
the URL), I have reconstructed a Session from a sessionID String. So I
guess if you can get the sessionID out of the cookie, then you can
reconstruct the Session. Sorry, I've been a bit lazy and not looked at
the code for cookies to complete your question, but I can do if you
need further help.
private Session session = (Session)
application().restoreSessionWithID(sid, this.context());
where "sid" is a String containing the sessionID e.g.
"gIy4xkxblFbZlkXbIjIPeg". It uses:
restoreSessionWithID(String aSessionID, WOContext aContext) from
WOApplication. So if you can get this String out of the cookie then you
can restore the Session and I guess just discard the one that WO
automatically creates when the user returns. The usual caveats about
the Session timing-out still stands if the user takes too long surfing
outside your application.
neilmac
_______________________________________________
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.