Index: trunk/zoo-project/zoo-kernel/ulinet.c
===================================================================
--- trunk/zoo-project/zoo-kernel/ulinet.c	(revision 831)
+++ trunk/zoo-project/zoo-kernel/ulinet.c	(revision 834)
@@ -70,5 +70,5 @@
 /**
  * In case of presence of "Set-Cookie" in the headers red, store the cookie
- * identifier in CCookie
+ * identifier in cookie
  *
  * @param buffer the buffer to read
@@ -77,5 +77,5 @@
  * @param data the _HINTERNET structure to write in
  * @return the size red, -1 if buffer is NULL
- * @see CCookie
+ * @see cookie
  */
 size_t header_write_data(void *buffer, size_t size, size_t nmemb, void *data){
@@ -89,8 +89,10 @@
 	;
 #endif
+    tmp=strtok(buffer,";");
+    int cnt=0;
     _HINTERNET *psInternet=(_HINTERNET *)data;
-    tmp=strtok(buffer,";");
-    if(tmp!=NULL){
-      sprintf(CCookie[psInternet->id],"%s",tmp);
+    if(tmp!=NULL && psInternet!=NULL){
+      psInternet->cookie=(char*)malloc(sizeof(char)*(strlen(tmp)+1));
+      sprintf(psInternet->cookie,"%s",tmp);
     }
   }
@@ -334,6 +336,8 @@
     if(handle.url!=NULL)
       free(handle.url);
-    free(handle.mimeType);
-    handle.mimeType = NULL;
+    if(handle.mimeType!=NULL)
+      free(handle.mimeType);
+    if(handle.cookie!=NULL)
+      free(handle.cookie);
   }
   if(handle0->handle)
@@ -365,4 +369,5 @@
   hInternet->ihandle[hInternet->nb].url = NULL;
   hInternet->ihandle[hInternet->nb].mimeType = NULL;
+  hInternet->ihandle[hInternet->nb].cookie = NULL;
   hInternet->ihandle[hInternet->nb].nDataLen = 0;
   hInternet->ihandle[hInternet->nb].id = hInternet->nb;
@@ -370,5 +375,5 @@
   hInternet->ihandle[hInternet->nb].pabyData = NULL;
   hInternet->ihandle[hInternet->nb].post = NULL;
-
+  
   curl_easy_setopt(hInternet->ihandle[hInternet->nb].handle, CURLOPT_COOKIEFILE, "ALL");
 #ifndef TIGER
@@ -474,12 +479,14 @@
 
 /**
- * Initialize the CCookie for a specific index (hInternet.nb)
- *
- * @param hInternet the HINTERNET structure to know the CCookie index to reset
+ * Initialize the cookie for a specific index (hInternet.nb)
+ *
+ * @param hInternet the HINTERNET structure to know the cookie index to reset
  * @return 1
  * @see HINTERNET
  */
 int freeCookieList(HINTERNET hInternet){
-  memset(&CCookie[hInternet.nb][0],0,1024);
+  if(hInternet.ihandle[hInternet.nb].cookie)
+    free(hInternet.ihandle[hInternet.nb].cookie);
+  hInternet.ihandle[hInternet.nb].cookie=NULL;
 #ifndef TIGER
   curl_easy_setopt(hInternet.ihandle[hInternet.nb].handle, CURLOPT_COOKIELIST, "ALL");
@@ -530,6 +537,4 @@
   }
 
-  CCookie[hInternet.id][0]=0;
-
   if( *lpdwNumberOfBytesRead < dwDataSize )
       return 0;
Index: trunk/zoo-project/zoo-kernel/ulinet.h
===================================================================
--- trunk/zoo-project/zoo-kernel/ulinet.h	(revision 831)
+++ trunk/zoo-project/zoo-kernel/ulinet.h	(revision 834)
@@ -54,13 +54,4 @@
 #define MAX_REQ 50
 
-#ifdef _ULINET
-static char CCookie[MAX_REQ][1024];
-#else
-/**
- * The cookies found
- */
-extern char CCookie[MAX_REQ][1024];
-#endif
-
 #ifdef __cplusplus
 extern "C" {
@@ -88,4 +79,5 @@
     char *mimeType; //!< the mimeType returned by the server
     char *post; //!< the potential POST XML content
+    char* cookie; //!< The potential Cookie returned by the server
     int hasCacheFile; //!< 1 if we used a cache file
     int nDataLen; //!< the length of the downloaded content
