Re: [Solved] Session id in URL in result page...
Re: [Solved] Session id in URL in result page...
- Subject: Re: [Solved] Session id in URL in result page...
- From: Jacky Gagnon <email@hidden>
- Date: Wed, 16 Mar 2005 11:18:31 -0500
Hi!
You were right!
I create a new class (its difficult to subclass because they use many private attributes) and I modified appendToResponse for adding the session ID in URL only if the session store it in the URL; I don't have to put the sessionID in the cookie because its already there :
public void appendToResponse(WOResponse aResponse, WOContext aContext) {
if (!_performingAction) {
_performingAction = true;
try {
Thread t = new Thread(this);
t.start();
} catch (Exception localException) {
throw new RuntimeException ("<WOLongResponsePage> Exception occurred while creating long response thread: "+localException.toString());
}
}
// If the refreshInterval was set and we did not get a result yet, let's add the refresh header.
if ((_refreshInterval!=0) && !_done) {
String modifiedDynamicUrl = aContext.urlWithRequestHandlerKey(WOApplication.application().componentRequestHandlerKey(), null, null);
String header = null;
if ( aContext.session().storesIDsInCookies() && !aContext.session().storesIDsInURLs() )
header = "" +_refreshInterval+ ";url=" +modifiedDynamicUrl+ "/" +aContext.contextID()+ "." +WOMetaRefreshSenderId;
else
header = "" +_refreshInterval+ ";url=" +modifiedDynamicUrl+ "/" + aContext.session().sessionID()+ "/" +aContext.contextID()+ "." +WOMetaRefreshSenderId;
aResponse.setHeader(header, "Refresh");
} else if ( (_refreshInterval!=0) && _done && ! _doneAndRefreshed ) {
// If the response is done and finished quickly (before the first branch of this conditional is invoked),
// make sure to refresh the page immediately.
String modifiedDynamicUrl = aContext.urlWithRequestHandlerKey(WOApplication.application().componentRequestHandlerKey(), null, null);
String header = null;
if ( aContext.session().storesIDsInCookies() && !aContext.session().storesIDsInURLs() )
header = "0;url=" +modifiedDynamicUrl+ "/" +aContext.contextID()+ "." +WOMetaRefreshSenderId;
else
header = "0;url=" +modifiedDynamicUrl+ "/" + aContext.session().sessionID()+ "/" +aContext.contextID()+ "." +WOMetaRefreshSenderId;
aResponse.setHeader(header, "Refresh");
_doneAndRefreshed = true;
}
super.appendToResponse(aResponse, aContext);
}
Thanks!
Jacky :-)
Le 05-03-16, à 02:59, Stephane Guyot a écrit :
Jacky,
on MacOS X in /Developer/Examples/JavaWebObjects/Source/JavaWOExtensions you have the source of WOLongResponsePage.java
I think you can subclass and try quikly to modify appendToResponse to have sessionID stored in cookies.
HTH,
Stephane
Le 16 mars 05, à 01:23, Jacky Gagnon a écrit :
Hi,
I have an application where I store the session id in the cookie (with setSoresIDsInCookies(true) etc.). All is OK except for result pages generated by WOLongResponse. If i invoke an action on the result page, the ID return in the cookie.
Why the result page of a WOLongResponse have the session ID in URL like this : uXih3mgvo1tDcg4VhwYHWM/11.WOMetaRefresh ?
How I can resolve this (I don't want to see the session id in URL)?
Thanks
Jacky
_______________________________________________
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
_______________________________________________
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