Q:

How to get cookie using objective-c

I'm converting a java applet program to ipad version.
In the original java applet code, there are some code to get cookie from javascript:
    JSObject browser = (JSObject) JSObject.getWindow(this);
    JSObject document =  (JSObject) browser.getMember("document");
    String cookie = (String)document.getMember("cookie"); 

So, how can I get this cookie using objective-c? Are there any similar classes or methods that can do the same thing? Thanks. :)
========UPDATE========
NSString *cookie = [webView stringByEvaluatingJavaScriptFromString:@"document.cookie"];

using this method can read values from javascript code

A:

I found a way to get cookies.
NSString *cookie = [webView stringByEvaluatingJavaScriptFromString:@"document.cookie"];

using this method can read a value directly from javascript

