[webkit-dev] Cookies in GDK Port

sachin J Puranik sachin.puranik at celunite.com
Thu Jul 5 06:46:47 PDT 2007


Actully,
Once you give the file name ,I think by default curl starts saving your
cookies as and when you receive them. So i think you need not to call
curl_easy_clenup(). I am not sure of this.

The best solution i think is disable the cookie handling in the curl.
and handle it on your own outside the webkit, Through the Cookiejar
interface. setCookie,Cookies, and cookiesEnabled functions.

if curl creates the cookie file , you will have following problems.

1) Deleting individual cookie from the Cookie list is not supported.
2) Disabling the Cookies Runtime is not supported. if you want to
achieve this you need to forcefully add the cookie header in the
request , so that curl does not add , which is a over head.
3)you will not be able to show the cookie list with the details to user.
It's not that it is not possible. but then again you need to get the
info from curl and show it......
4) you will have to maintain the list of Blocked domains outside and
handle it. so cookie handling will be at two places.
5) even i saw a bug in the curl cookie handling in GDK port. 
	login to gmail.com>close the window> Try to fetch the gmail...gmail
will not come. it is due to cookies.


Regards
Sachin




On Wed, 2007-07-04 at 21:48 +0200, Holger Freyther wrote:
> Am 22.06.2007 um 16:26 schrieb sachin J Puranik:
> 
> > Basically file WebCore/platform/gdk/CookieJarGdk.cpp contains  
> > setCookies, cookies, enableCookies functions.
> > Which are called from JS Core through Document->HTMLDocument.This i  
> > already know.
> >>> From ResourceHandleManager I already checked and it is actully  
> >>> passing setings to curl along with the CallBackfunctions.
> > It also facilitates to pass the CookieJar file name to curl ...and  
> > further curl maintains it. this also i checked earlier.
> >
> > So from my thinking curl is responsible for adding the cookies to  
> > the request and saving them in the file.
> > But there are following problems...
> >
> > 1) I Gave the CookieJar file name to curl, and even file is  
> > created. Now if i Login to Gmail, Close the browser and Again try  
> > to load Gmail it's not opening.
> > it is definitely due to problem in cookie handling.
> > 2) If i Want to show the Available Cookies details to user , i can  
> > not do that , as file exists with curl.
> >
> > Please suggest me some architectural changes ..?? which solves my  
> > both the problems...??
> > the solution you suggested earlier may not serve my purpose.
> 
> Well,
> 
> I just browsed the documentation of curl and stumbled across this part
> 
> "CURLOPT_COOKIEJAR
> Pass a file name as char *, zero terminated. This will make libcurl  
> write all internally known cookies to the specified file when  
> curl_easy_cleanup(3) is called."
> 
> And we never call curl_easy_cleanup, actually I make it call  
> curl_easy_cleanup but the d'tor of ResourceHandleManager is never  
> called. The question is how to call curl_easy_cleanup without  
> interfering with pending requests.
> 
> What about you sharing some ideas on how to solve this problem?
> 
> One of the obvious solutions is to call cleanup when all pending  
> operations are done and then create a new one. The danger is  
> "starving", to avoid this we could hot-swap but risk losing a cookie  
> on this way. Looking forward for your ideas.
> 
> 
> 
> z.
> 
> 
> 
> 
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo/webkit-dev




More information about the webkit-dev mailing list