httpfilters/cookie/ManagerSrc/CookieClientData.cpp
branchRCL_3
changeset 15 bdd8a827a7de
parent 8 73e95e652591
--- a/httpfilters/cookie/ManagerSrc/CookieClientData.cpp	Wed Jun 09 10:16:57 2010 +0300
+++ b/httpfilters/cookie/ManagerSrc/CookieClientData.cpp	Mon Jun 21 16:17:02 2010 +0300
@@ -9,7 +9,8 @@
 #include "cookie.h"
 #include "CookieArray.h"
 #include "CookieLogger.h"
-
+#include "CookieCommonConstants.h"
+#include <uri8.h>
 
 // ---------------------------------------------------------
 // CCookieGroupData::NewL
@@ -122,9 +123,29 @@
     {
     CLOG(( EClient, 0, _L("-> RCookieManager::StoreCookieAtClientSideL: aUri:%S"), &aUri ));
     //Creates a clone of the passed cookie objects as the ownership of this object is held by Clint of Cookie Manager Dll
+    TUriParser8 uriParser;
     
-    CCookie* clone = CCookie::CloneL( *aCookie );
-    CleanupStack::PushL( clone );
+    TInt err = uriParser.Parse( aUri );
+    CCookie* clone(NULL);
+    if (err !=KErrNone)
+        return;
+    else
+        {
+        // first get the details of the current requestUri,
+        // that is, Domain, Path and port
+        TPtrC8 requestPath( uriParser.IsPresent( EUriPath ) ?
+                            uriParser.Extract( EUriPath ) : KNullDesC8() );
+        TPtrC8 requestDomain( uriParser.IsPresent( EUriHost ) ?
+                            uriParser.Extract( EUriHost ) : KNullDesC8() );
+        TPtrC8 requestPort( uriParser.IsPresent( EUriPort ) ?
+                uriParser.Extract( EUriPort ) : KCookieDefaultRequestPort() );
+
+        clone = CCookie::CloneL( *aCookie,requestDomain,requestPath,requestPort);
+        CleanupStack::PushL( clone );
+        }
+
+    //CCookie* clone = CCookie::CloneL( *aCookie,requestDomain,requestPath);
+    //CleanupStack::PushL( clone );
   
     TInt index(0);
     CCookieArray* perscookiearray = CookieArray();