--- build-ppc750/lib/http.c	2012-03-06 08:11:03.000000000 +0200
+++ build-x86_64/lib/http.c	2012-03-06 11:53:51.000000000 +0200
@@ -1855,13 +1855,24 @@
       return CURLE_OUT_OF_MEMORY;
     if(!*cookiehost)
       /* ignore empty data */
       free(cookiehost);
     else {
-      char *colon = strchr(cookiehost, ':');
-      if(colon)
-        *colon = 0; /* The host must not include an embedded port number */
+      /* If the host begins with '[', we start searching for the port after
+         the bracket has been closed */
+      int startsearch = 0;
+      if(*cookiehost == '[') {
+        cookiehost++;
+        char *closingbracket = strchr(cookiehost, ']');
+        if(closingbracket)
+          *closingbracket = 0;
+      }
+      else {
+        char *colon = strchr(cookiehost + startsearch, ':');
+        if(colon)
+          *colon = 0; /* The host must not include an embedded port number */
+      }
       Curl_safefree(conn->allocptr.cookiehost);
       conn->allocptr.cookiehost = cookiehost;
     }
 #endif
 
