Update: I tried clearing the created cookie in the browser and trying it again, and it didn't happen. Conceivably I set a cookie with the value "null" at some point.
(Ok, this is probably a retorical question, so I'm making it CW)
The documentation for Google Web Toolkit says this about Cookies.getCookie:
public static java.lang.String getCookie(java.lang.String name)
Gets the cookie associated with the given name.
Parameters:
- name - the name of the cookie to be retrieved
Returns:
- the cookie's value, or null if the cookie doesn't exist
Well, I've just spent a number of hours beating my head against a wall because at least in the hosted mode browser (I haven't tested with a real browser yet), it doesn't return null, it returns "null", ie the literal string, 4 characters long starting with "n".
Both null and "null" look remarkably similar if you print them out, but only one responds to a if (cookie == null) Cookies.setCookie(cookie, newValue);
Is there any conceivable reason why Google did it this way, or is somebody just screwing me around?