Re: WOApp hangs, is it the cookie?
Re: WOApp hangs, is it the cookie?
- Subject: Re: WOApp hangs, is it the cookie?
- From: Chuck Hill <email@hidden>
- Date: Fri, 19 Mar 2004 09:09:46 -0800
There is a bug in cookie handling up to 5.2.2. This is supposed to be
fixed in 5.2.3 but I'm not brave enough to check it out. :-)
If the app receives an invalid cookie string (I think the problem is
where the last cookie has no value) then Bad Things TM happen. In the
cookie below if curRegionName was null then an invalid cookie would be
set. I don't have the code at hand but if you search wocode, wodev or
the archives I'm pretty sure you find it.
You can test this out by deleting all the cookies on the client machine
and seeing if you can access the application.
For testing and debugging things like cookies, a http proxy that logs
the conversation can be invaluable. WebScarab from OWASP is free and
works reasonably well - give or take a few quirks.
Chuck
On Mar 19, 2004, at 8:02 AM, Baiss Eric Magnusson wrote:
I posted a question about what was the meaning behind a WO app that
gave a http/servlet response of 200,0 into the Server logs and left
the browser page blank.
I am investigating the possibility that the app just hung.
I am introducing WOCookies into the app, it seems to me that in
development mode there is no way to check if the cookies are doing
anything, i.e. when I run the app in development mode everything works
ok but I don't have any measurement of the success or failure of the
cookie logic. So I had hoped that the cookies would work when the app
was deployed.
At any rate, in my constructor code in Main I have:
NSArray allCookies = context.request().cookies();
curRegionName = context.request().cookieValueForKey( "region" );
if ( curRegionName == null ) {
curRegionName = "Iceland";
cookie = new WOCookie( "region", curRegionName, "/", ".nwSufis.org",
-1, false );
cookie.setExpires(null);
newCookie = true;
} else {
cookie = (WOCookie)allCookies.objectAtIndex(0);
}
Is this not the way to get to cookies if present and to create the 1st
one otherwise?
----
Baiss Eric Magnusson
<http://www.Track-Your-Finances.com>
<http://www.CascadeWebDesign.com>
_______________________________________________
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.
_______________________________________________
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.