Re: Apache Rewrite [L,PT] vs [L,R], sessions, and WebObjects
Re: Apache Rewrite [L,PT] vs [L,R], sessions, and WebObjects
- Subject: Re: Apache Rewrite [L,PT] vs [L,R], sessions, and WebObjects
- From: Olav Anderson <email@hidden>
- Date: Thu, 9 Dec 2004 09:46:56 -0800
One way I worked around this problem was to override in in WOComponent
appendToResponse(WOResponse, WOContext) and create two WOCookie's for
the rewrite path of my choice with the sessionID and app instance and
leave the domainForIDCookies() for the app to handle.
That way any requests from the rewrite path will get the same cooke as
requests from the component action requests.
So it doesn't matter where the request comes from the sessionId and app
instance will be passed to the app.
-Olav
On Dec 9, 2004, at 9:24 AM, Chuck Hill wrote:
Yes. In that case you have more work to do. The least amount of
effort is to add some indication of the app as the first element of
the URL:
http://www.domain.com/app1/some/apth
http://www.domain.com/app2/some/other/path
then
public String domainForIDCookies()
{
return "/app1";
}
This _won't_ work with component action or any other URL that is not
in the above format.
Otherwise, you need to replace how WO works with session ID cookies
and that is a fair bit of effort.f
Chuck
On Dec 9, 2004, at 9:12 AM, Olav Anderson wrote:
If you had more that one (different) wo app running couldn't the
wrong sessionid be passed back if both are being used at the same
time by the same user?
On Dec 9, 2004, at 8:16 AM, Chuck Hill wrote:
Simple! Add this method to Session:
/**
* Despite the name, this is actually the path used in the
cookies for
the session ID and instance number. Returning just the root '/'
ensures
that the cookies are always sent for any request to the site. This
was
needed so that they are sent with URLs which will be rewritten.
Note that
super.domainForIDCookies() would return: /cgi-bin/WebObjects/App.woa
*/
public String domainForIDCookies()
{
return "/";
Chuck
At 09:06 AM 09/12/2004 -0700, Brendan Duddridge wrote:
Hi,
We use Apache rewrite rules to convert our WebObjects URLs into
simpler
URLs. However, if I use [L, PT] (last, pass through) instead of [L,
R]
(last, redirect) in my rewrite rules, WebObjects creates a new
session for
each request.
Is there a workaround for this? The problem is that if I use [L, R]
in my
rewrite rule, a 302 redirect is generated for every click to our
sites.
That¹s like double the number of hits to our web server. I have the
session
ID set in a cookie (and not in the URL), so you would think that
WebObjects
would still be able to read that and direct requests to the same
instance
and session for subsequent requests.
I¹m kind of thinking of a possible workaround right now. It may
have to do
with the default path that WO uses when it sets the woinst and wosid
cookies. I think the default path is /cgi-bin/WebObjects/WOApp.woa.
Perhaps
there¹s a way to change it to Œ/¹ just like you can when you create
your own
WOCookie.
Does anyone have any ideas about this or workarounds?
Thanks,
___________________________
Brendan Duddridge
ClickSpace Interactive Inc.
Suite L100
239 - 10th Ave SE
Calgary, AB T2G 0V9
Canada
(403) 277-5591
http://www.clickspace.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
chill@global-villag
e.net
This email sent to email@hidden
--
Chuck Hill email@hidden
Global Village Consulting Inc.
http://www.global-village.net
_______________________________________________
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:
village.net
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:
This email sent to email@hidden
References: | |
| >Re: Apache Rewrite [L,PT] vs [L,R], sessions, and WebObjects (From: Chuck Hill <email@hidden>) |
| >Re: Apache Rewrite [L,PT] vs [L,R], sessions, and WebObjects (From: Olav Anderson <email@hidden>) |
| >Re: Apache Rewrite [L,PT] vs [L,R], sessions, and WebObjects (From: Chuck Hill <email@hidden>) |
- Prev by Date:
Re: Practical WebObjects Authentification scheme
- Next by Date:
Re: Apache Rewrite [L,PT] vs [L,R], sessions, and WebObjects
- Previous by thread:
Re: Apache Rewrite [L,PT] vs [L,R], sessions, and WebObjects
- Next by thread:
Re: Apache Rewrite [L,PT] vs [L,R], sessions, and WebObjects
- Index(es):