Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

HTTP-COOKIES: clarified and modified layout

  • Loading branch information...
commit 016dabcf047a5788812d86bdbd69b2da7f9faee1 1 parent ae8f08e
@bagder authored
Showing with 22 additions and 14 deletions.
  1. +22 −14 docs/HTTP-COOKIES
View
36 docs/HTTP-COOKIES
@@ -8,15 +8,18 @@ Updated: July 3, 2012 (http://curl.haxx.se/docs/http-cookies.html)
HTTP Cookies
- 1. Cookie overview
- 2. Cookies saved to disk
- 3. Cookies with curl the command line tool
- 4. Cookies with libcurl
- 5. Cookies with javascript
+ 1. HTTP Cookies
+ 1.1 Cookie overview
+ 1.2 Cookies saved to disk
+ 1.3 Cookies with curl the command line tool
+ 1.4 Cookies with libcurl
+ 1.5 Cookies with javascript
==============================================================================
-1. Cookie overview
+1. HTTP Cookies
+
+ 1.1 Cookie overview
HTTP cookies are pieces of 'name=contents' snippets that a server tells the
client to hold and then the client sends back those the server on subsequent
@@ -36,18 +39,21 @@ HTTP Cookies
In 2011, RFC6265 (http://www.ietf.org/rfc/rfc6265.txt) was finally published
and details how cookies work within HTTP.
-2. Cookies saved to disk
+ 1.2 Cookies saved to disk
Netscape once created a file format for storing cookies on disk so that they
would survive browser restarts. curl adopted that file format to allow
sharing the cookies with browsers, only to see browsers move away from that
format. Modern browsers no longer use it, while curl still does.
- The cookie file format stores one cookie per physical line in the file with
- a bunch of associated meta data, each field separated with TAB. That file is
- called the cookiejar in curl terminology.
+ The netscape cookie file format stores one cookie per physical line in the
+ file with a bunch of associated meta data, each field separated with
+ TAB. That file is called the cookiejar in curl terminology.
+
+ When libcurl saves a cookiejar, it creates a file header of its own in which
+ there is a URL mention that will link to the web version of this document.
-3. Cookies with curl the command line tool
+ 1.3 Cookies with curl the command line tool
curl has a full cookie "engine" built in. If you just activate it, you can
have curl receive and send cookies exactly as mandated in the specs.
@@ -70,9 +76,11 @@ HTTP Cookies
tell curl to start the cookie engine and write cookies to the given file
after the request(s)
-4. Cookies with libcurl
+ 1.4 Cookies with libcurl
- libcurl options:
+ libcurl offers several ways to enable and interface the cookie engine. These
+ options are the ones provided by the native API. libcurl bindings may offer
+ access to them using other means.
CURLOPT_COOKIE
@@ -101,7 +109,7 @@ HTTP Cookies
Extract cookie information from the internal cookie storage as a linked
list.
-5. Cookies with javascript
+ 1.5 Cookies with javascript
These days a lot of the web is built up by javascript. The webbrowser loads
complete programs that render the page you see. These javascript programs
Please sign in to comment.
Something went wrong with that request. Please try again.