Learn R Programming

curl (version 0.9.3)

handle_cookies: Extract cookies from a handle

Description

The handle_cookies function returns a data frame with 7 columns as specified in the http://www.cookiecentral.com/faq/#3.5{netscape cookie file format}.

Usage

handle_cookies(handle)

Arguments

handle
a curl handle object

See Also

Other handles: handle, handle_reset, handle_setform, handle_setheaders, handle_setopt, new_handle

Examples

Run this code
h <- new_handle()
handle_cookies(h)

# Server sets cookies
req <- curl_fetch_memory("http://httpbin.org/cookies/set?foo=123&bar=ftw", handle = h)
handle_cookies(h)

# Server deletes cookies
req <- curl_fetch_memory("http://httpbin.org/cookies/delete?foo", handle = h)
handle_cookies(h)

# Cookies will survive a reset!
handle_reset(h)
handle_cookies(h)

Run the code above in your browser using DataLab