Re: WOCookie & Safari
Re: WOCookie & Safari
- Subject: Re: WOCookie & Safari
- From: Andrew Lindesay <email@hidden>
- Date: Tue, 4 Mar 2008 13:16:42 +1300
Hello Ryan;
I stuck this...
// [apl 18.feb.2008]
// WebObjects 5.4.1 has a problem dealing with cookies that have their
value as
// an empty string. This little block of code should be able to
remove those
// such that they no longer pose a problem for the WO parser. This
MUST BE
// removed once this problem has been resolved in WO.
if(null!=someHeaders)
{
List cookieValues = (List) someHeaders.get("cookie");
if(null!=cookieValues)
{
for(int i=0;i<cookieValues.size();)
{
String cookieValue = (String) cookieValues.get(i);
if((-1!=cookieValue.indexOf("=;")) || cookieValue.endsWith("="))
{
StringBuffer sb = new StringBuffer();
List<String> pairs =
LEStringHelper.splitUpWithDelimiter(cookieValue, ';');
Iterator<String> pairsI = pairs.iterator();
while(pairsI.hasNext())
{
String pair = pairsI.next();
int equalsIdx = pair.indexOf('=');
if((-1!=equalsIdx) && (equalsIdx != pair.length()-1))
{
String key = LEStringHelper.trim(pair.substring(0, equalsIdx));
String value = LEStringHelper.trim(pair.substring(equalsIdx+1));
if((0!=key.length()) && (0!=value.length()))
{
if(0!=sb.length())
sb.append(";");
sb.append(key);
sb.append("=");
sb.append(value);
}
}
}
if(0!=sb.length())
{
cookieValues.set(i, sb.toString());
i++;
}
else
cookieValues.remove(i);
}
else
i++;
}
if(0==cookieValues.size())
someHeaders.remove("cookie");
}
}
...into...
WOApplication.createRequest(..)
...but I have also gone back to WO 5.3.3 for now owing to some other
issues I had which are going to be fixed in the next version. I would
stick to WO 5.3.3 and then try again with WO 5.4.2.
Hope this helps.
cheers.
I just tried this and also had the same problem under safari. It
would appear that safari is ignoring the max-age attribute, and
treating the cookie as a session cookie. I've filed a radar on the
safari team. Firefox does treat the cookie properly.
___
Andrew Lindesay
technology : www.lindesay.co.nz
business : www.silvereye.co.nz
_______________________________________________
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