Re: Session Question
Re: Session Question
- Subject: Re: Session Question
- From: Jan Willem Luiten <email@hidden>
- Date: Tue, 8 Feb 2005 23:30:16 +0100
Hello Gerald,
Add the following method to your application class:
public WOSession createSessionForRequest(WORequest aRequest) {
//NSTimestamp aTime = new NSTimestamp();
WOSession aSession = null;
WOContext aContext = new WOContext(aRequest);
String aSessionID = aRequest.cookieValueForKey("wosid");
if((aContext != null) && (aSessionID != null) &&
(!aSessionID.equals(""))) {
//System.out.println("Attempting to restore session: " + aSessionID
+ " at: " + aTime);
aSession = (Session) restoreSessionWithID(aSessionID, aContext);
}
if(aSession == null) {
//System.out.println("A new session was created at: " + aTime);
aSession = (Session) super.createSessionForRequest(aRequest);
WeakReference aReference = new WeakReference(aSession);
} else {
//System.out.println("An old session was restored at: " + aTime);
}
return aSession;
}
Kind regards,
Jan Willem Luiten.
On Feb 8, 2005, at 22:26, Gerald Hanks wrote:
I have an application called Test that I am developing. I can access
the app at http://www.mydomain.com/cgi-bin/WebObjects/Test.woa I have
the application set to store session ids in cookies. I can start a
session and everything works well until I leave the site and return.
If I return by back tracking my session is still active. If I return
using a direct action such as
http://www.mydomain.com/cgi-bin/WebObjects/Test.woa/wa/default then my
session is still active. If I return using the application url
http://www.mydomain.com/cgi-bin/WebObjects/Test.woa then a new session
is created and I lose all my session information.
Is this the way things are supposed to happen or am I doing something
wrong? How can I allow users to leave my webobjects application and
return without losing their sessions? My understanding was all I had
to do was to store the session ids in cookies.
--gerald
_______________________________________________
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