File: README.html

package info (click to toggle)
clientcookie 0.4.19-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 480 kB
  • ctags: 571
  • sloc: python: 4,213; makefile: 46
file content (186 lines) | stat: -rw-r--r-- 7,781 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <meta name="author" content="John J. Lee &lt;jjl@pobox.com&gt;">
  <meta name="date" content="2004-05">
  <meta name="keywords" content="cookie,HTTP,Python,web,client,client-side,HTML,META,HTTP-EQUIV,Refresh">
  <title>ClientCookie</title>
  <style type="text/css" media="screen">@import "../styles/style.css";</style>
  <style type="text/css" media="screen">@import "../styles/cookie_style.css";</style>
  <base href="http://wwwsearch.sourceforge.net/ClientCookie/">
</head>
<body>



<div id="sf"><a href="http://sourceforge.net">
<img src="http://sourceforge.net/sflogo.php?group_id=48205&amp;type=2"
 width="125" height="37" alt="SourceForge.net Logo"></a></div>
<!--<img src="../images/sflogo.png"-->

<h1>ClientCookie</h1>

<div id="Content">

<p>ClientCookie is a <a href="http://www.python.org/">Python</a> module for
handling HTTP cookies on the client side, useful for accessing web sites that
require cookies to be set and then returned later.  It also provides some other
(optional) useful stuff: <code>HTTP-EQUIV</code> and <code>Refresh</code>
handling, automatic adding of the <code>Referer</code> [<em><a
href="http://www.ietf.org/rfc/rfc2616.txt">sic</a></em>] header, automatic
observance of <code>robots.txt</code> and lazily-<code>seek()</code>able
responses.  These extras are implemented using an extension that makes it
easier to add new functionality to <code>urllib2</code>.  It has developed from
a port of Gisle Aas' Perl module <code>HTTP::Cookies</code>, from the <a
href="http://www.linpro.no/lwp/">libwww-perl</a> library.

<pre>
 <span class="pykw">import</span> ClientCookie
 response = ClientCookie.urlopen(<span class="pystr">"http://foo.bar.com/"</span>)</pre>


<p>This function behaves identically to <code>urllib2.urlopen</code>, except
that it deals with cookies automatically.  That's probably all you need to
know.

<p>Python 1.5.2 or above is required, and <code>urllib2</code> is recommended.
If you have 2.1 or above, you've already got a recent enough version of
<code>urllib2</code>.  For Python 1.5.2, use this <a href="../bits/urllib2.py">
<code>urllib2</code></a> and this <a href="../bits/urllib.py">
<code>urllib</code></a>.  For Python 2.0, you need the newer versions from
Python 2.1 (available from the source distribution or CVS from <a
href="http://www.python.org/">http://www.python.org/</a>), or use the
1.5.2-compatible versions.  Note that you don't need to replace the original
<code>urllib2</code> / <code>urllib</code> - you can just make sure they're in
<code>sys.path</code> ahead of the copies from 2.0's standard library.

<p>For full documentation, see <a href="./doc.html">here</a> and the docstrings
in the module source code.

<p>Other than Gisle, particular thanks to Johnny Lee (MSIE Perl code) and
Ronald Tschalar (advice on Netscape cookies).

<a name="download"></a>
<h2>Download</h2>

<p>All documentation (including these web pages) is included in the
distribution.

<p><em>Development release.</em>

<ul>
<li><a href="./src/ClientCookie-0.9.4a.tar.gz">ClientCookie-0.9.4a.tar.gz</a>
<li><a href="./src/ClientCookie-0_9_4a.zip">ClientCookie-0_9_4a.zip</a>
<li><a href="./src/ChangeLog.txt">Change Log</a> (included in distribution)
<li><a href="./src/">Older versions.</a>
</ul>

<br>

<p><em>Stable release.</em>

<ul>
<li><a href="./src/ClientCookie-0.4.19.tar.gz">ClientCookie-0.4.19.tar.gz</a>
<li><a href="./src/ClientCookie-0_4_19.zip">ClientCookie-0_4_19.zip</a>
<li><a href="./src/ChangeLog.txt">Change Log</a> (included in distribution)
<li><a href="./src/">Older versions.</a>
</ul>

<p>For installation instructions, see the INSTALL file included in the
distribution.

<a name="faq_pre"></a>
<h2>FAQs - pre-install</h2>
<ul>
  <li>Doesn't the standard Python library module, <code>Cookie</code>, do
     this?
  <p>No: Cookie.py does the server end of the job.  It doesn't know when to
     accept cookies from a server or when to pass them back.
  <li>Which version of Python do I need?
  <p>1.5.2 or above.
  <li>Is urllib2.py required?
  <p>No.  You probably want it, though.
  <li>Which urllib2.py do I need?
  <p>You don't, but if you want to use the extended <code>urllib2</code>
     callables from ClientCookie, and you have Python 2.0, you need to
     upgrade to the version from Python 2.1 (or use the 1.5.2-compatible
     version).  If you have Python 1.5.2, use this
     <a href="../bits/urllib2.py"><code>urllib2</code></a> and
     <a href="../bits/urllib.py"><code>urllib</code></a>. Otherwise, you're OK.
  <li>Which license?
     <p>The <a href="http://www.opensource.org/licenses/bsd-license.php">
     BSD license</a> (included in distribution).
  <li>Where can I find out more about the HTTP cookie protocol?
  <p>There is more than one protocol, in fact (see the <a href="./doc.html">docs</a>
     for a brief explanation of the history):
  <ul>
    <li>The original <a href="http://www.netscape.com/newsref/std/cookie_spec.html">
        Netscape cookie protocol</a> - the standard still in use today, in
        theory (in reality, the protocol implemented by all the major browsers
        only bears a passing resemblance to the protocol sketched out in this
        document).
    <li><a href="http://www.ietf.org/rfcs/rfc2109.txt">RFC 2109</a> - obsoleted
        by RFC 2965.
     <li><a href="http://www.ietf.org/rfcs/rfc2965.txt">RFC 2965</a> - the
        Netscape protocol with the bugs fixed (not widely used - the Netscape
        protocol still dominates, and seems likely to remain dominant
        indefinitely, at least on the Internet).
        <a href="http://www.ietf.org/rfcs/rfc2964.txt">RFC 2964</a> discusses use
        of the protocol.
        <a href="http://kristol.org/cookie/errata.html">Errata</a> to RFC 2965
        are currently being discussed on the
        <a href="http://lists.bell-labs.com/mailman/listinfo/http-state">
        http-state mailing list</a> (update: list traffic died months ago and
        hasn't revived).
    <li>A <a href="http://doi.acm.org/10.1145/502152.502153">paper</a> by David
        Kristol setting out the history of the cookie standards in exhausting
        detail.
    <li>HTTP cookies <a href="http://www.cookiecentral.com/">FAQ</a>.
  </ul>
  <li>Which protocols does ClientCookie support?
     <p>Netscape and RFC 2965.  RFC 2965 handling is switched off by default.
  <li>What about RFC 2109?
     <p>RFC 2109 cookies are currently parsed as Netscape cookies, and treated
     as RFC 2965 cookies thereafter.  RFC 2109 is officially obsoleted by RFC
     2965.  Browsers do use a few RFC 2109 features in their Netscape cookie
     implementations (<code>port</code> and <code>max-age</code>), and
     ClientCookie knows about that, too.
</ul>

<p><a href="mailto:jjl@pobox.com">John J. Lee</a>, May 2004.

<hr>

</div>

<div id="Menu">

<a href="..">Home</a><br>
<!--<a href=""></a><br>-->

<br>

<span class="thispage">ClientCookie</span><br>
<a href="../ClientCookie/doc.html"><span class="subpage">ClientCookie docs</span></a><br>
<a href="../ClientForm/">ClientForm</a><br>
<a href="../DOMForm/">DOMForm</a><br>
<a href="../python-spidermonkey/">python-spidermonkey</a><br>
<a href="../ClientTable/">ClientTable</a><br>
<a href="../mechanize/">mechanize</a><br>
<a href="../pullparser/">pullparser</a><br>
<a href="../bits/GeneralFAQ.html">General FAQs</a><br>
<a href="../bits/urllib2_152.py">1.5.2 urllib2.py</a><br>
<a href="../bits/urllib_152.py">1.5.2 urllib.py</a><br>

<br>

<a href="./#download">Download</a><br>
<a href="./#faq_pre">FAQs - pre-install</a><br>

</div>


</body>
</html>