Index: clinkc/src/cybergarage/http/chttp_cookie.c =================================================================== --- clinkc.orig/src/cybergarage/http/chttp_cookie.c 2015-04-16 20:14:57.392286635 +0800 +++ clinkc/src/cybergarage/http/chttp_cookie.c 2015-04-16 20:16:44.359262600 +0800 @@ -32,6 +32,12 @@ strncpy( name, attr, SIZE_COOKIE_NAME ); } + /*The NAME=VALUE attribute-value pair MUST come first in each cookie.*/ + if(strlen(value)>0 && strlen(cookiedata->name)==0){ + strncpy(cookiedata->name, name, SIZE_COOKIE_NAME); + strncpy(cookiedata->value, value, SIZE_COOKIE_VALUE); + } + if(strcasecmp(name, CG_HTTP_COOKIE_COMMENT)==0 && strlen(value)>0 ){ strncpy(cookiedata->comment, value, SIZE_COOKIE_COMMENT); } @@ -66,13 +72,6 @@ else if(strcasecmp(name, CG_HTTP_COOKIE_AUTH)==0 && strlen(value)>0 ){ strncpy(cookiedata->authentication, value, SIZE_COOKIE_AUTH); } - else{ - /*The NAME=VALUE attribute-value pair MUST come first in each cookie.*/ - if(strlen(value)>0 && strlen(cookiedata->name)==0){ - strncpy(cookiedata->name, name, SIZE_COOKIE_NAME); - strncpy(cookiedata->value, value, SIZE_COOKIE_VALUE); - } - } }