]> sjero.net Git - wget/blobdiff - doc/wget.texi
[svn] Document new option `--keep-session-cookies'.
[wget] / doc / wget.texi
index 7619586023bc46e7005e6f0aea17ab85e1953b26..fcfa1fdcb0ddcc6f075ba9e668565f9dafde0a34 100644 (file)
@@ -768,8 +768,8 @@ Some web sites may perform log analysis to identify retrieval programs
 such as Wget by looking for statistically significant similarities in
 the time between requests. This option causes the time between requests
 to vary between 0 and 2 * @var{wait} seconds, where @var{wait} was
-specified using the @samp{-w} or @samp{--wait} options, in order to mask
-Wget's presence from such analysis.
+specified using the @samp{--wait} option, in order to mask Wget's
+presence from such analysis.
 
 A recent article in a publication devoted to development on a popular
 consumer platform provided code to perform this analysis on the fly.
@@ -848,7 +848,7 @@ When mode is set to ``unix'', Wget escapes the character @samp{/} and
 the control characters in the ranges 0--31 and 128--159.  This is the
 default on Unix-like OS'es.
 
-When mode is seto to ``windows'', Wget escapes the characters @samp{\},
+When mode is set to ``windows'', Wget escapes the characters @samp{\},
 @samp{|}, @samp{/}, @samp{:}, @samp{?}, @samp{"}, @samp{*}, @samp{<},
 @samp{>}, and the control characters in the ranges 0--31 and 128--159.
 In addition to this, Wget in Windows mode uses @samp{+} instead of
@@ -1057,9 +1057,28 @@ wget --cookies=off --header "Cookie: @var{name}=@var{value}"
 @cindex saving cookies
 @cindex cookies, saving
 @item --save-cookies @var{file}
-Save cookies from @var{file} at the end of session.  Cookies whose
-expiry time is not specified, or those that have already expired, are
-not saved.
+Save cookies to @var{file} before exiting.  This will not save cookies
+that have expired or that have no expiry time (so-called ``session
+cookies''), but also see @samp{--keep-session-cookies}.
+
+@cindex cookies, session
+@cindex session cookies
+@item --keep-session-cookies
+
+When specified, causes @samp{--save-cookies} to also save session
+cookies.  Session cookies are normally not save because they are
+supposed to be forgotten when you exit the browser.  Saving them is
+useful on sites that require you to log in or to visit the home page
+before you can access some pages.  With this option, multiple Wget runs
+are considered a single browser session as far as the site is concerned.
+
+Since the cookie file format does not normally carry session cookies,
+Wget marks them with an expiry timestamp of 0.  Wget's
+@samp{--load-cookies} recognizes those as session cookies, but it might
+confuse other browsers.  Also note that cookies so loaded will be
+treated as other session cookies, which means that if you want
+@samp{--save-cookies} to preserve them again, you must use
+@samp{--keep-session-cookies} again.
 
 @cindex Content-Length, ignore
 @cindex ignore length
@@ -1139,6 +1158,48 @@ servers denying information to clients other than @code{Mozilla} or
 Microsoft @code{Internet Explorer}.  This option allows you to change
 the @code{User-Agent} line issued by Wget.  Use of this option is
 discouraged, unless you really know what you are doing.
+
+@cindex POST
+@item --post-data=@var{string}
+@itemx --post-file=@var{file}
+Use POST as the method for all HTTP requests and send the specified data
+in the request body.  @code{--post-data} sends @var{string} as data,
+whereas @code{--post-file} sends the contents of @var{file}.  Other than
+that, they work in exactly the same way.
+
+Please be aware that Wget needs to know the size of the POST data in
+advance.  Therefore the argument to @code{--post-file} must be a regular
+file; specifying a FIFO or something like @file{/dev/stdin} won't work.
+It's not quite clear how to work around this limitation inherent in
+HTTP/1.0.  Although HTTP/1.1 introduces @dfn{chunked} transfer that
+doesn't require knowing the request length in advance, a client can't
+use chunked unless it knows it's talking to an HTTP/1.1 server.  And it
+can't know that until it receives a response, which in turn requires the
+request to have been completed -- a chicken-and-egg problem.
+
+Note: if Wget is redirected after the POST request is completed, it will
+not send the POST data to the redirected URL.  This is because URLs that
+process POST often respond with a redirection to a regular page
+(although that's technically disallowed), which does not desire or
+accept POST.  It is not yet clear that this behavior is optimal; if it
+doesn't work out, it will be changed.
+
+This example shows how to log to a server using POST and then proceed to
+download the desired pages, presumably only accessible to authorized
+users:
+
+@example
+@group
+# @r{Log in to the server.  This can be done only once.}
+wget --save-cookies cookies.txt \
+     --post-data 'user=foo&password=bar' \
+     http://server.com/auth.php
+
+# @r{Now grab the page or pages we care about.}
+wget --load-cookies cookies.txt \
+     -p http://server.com/interesting/article.php
+@end group
+@end example
 @end table
 
 @node FTP Options, Recursive Retrieval Options, HTTP Options, Invoking
@@ -2141,7 +2202,7 @@ Bind to @var{address}, like the @samp{--bind-address} option.
 @item cache = on/off
 When set to off, disallow server-caching.  See the @samp{-C} option.
 
-@item convert links = on/off
+@item convert_links = on/off
 Convert non-relative links locally.  The same as @samp{-k}.
 
 @item cookies = on/off
@@ -2307,6 +2368,14 @@ and @samp{.pm} (Perl module) files download files using @samp{wget
 Set your @sc{ftp} password to @var{password}.  Without this setting, the
 password defaults to @samp{username@@hostname.domainname}.
 
+@item post_data = @var{string}
+Use POST as the method for all HTTP requests and send @var{string} in
+the request body.  The same as @samp{--post-data}.
+
+@item post_file = @var{file}
+Use POST as the method for all HTTP requests and send the contents of
+@var{file} in the request body.  The same as @samp{--post-file}.
+
 @item progress = @var{string}
 Set the type of the progress indicator.  Legal types are ``dot'' and
 ``bar''.
@@ -2483,7 +2552,7 @@ If you specify a directory, Wget will retrieve the directory listing,
 parse it and convert it to @sc{html}.  Try:
 
 @example
-wget ftp://prep.ai.mit.edu/pub/gnu/
+wget ftp://ftp.gnu.org/pub/gnu/
 links index.html
 @end example
 @end itemize
@@ -2768,9 +2837,9 @@ username and password.
 @cindex latest version
 
 Like all GNU utilities, the latest version of Wget can be found at the
-master GNU archive site prep.ai.mit.edu, and its mirrors.  For example,
+master GNU archive site ftp.gnu.org, and its mirrors.  For example,
 Wget @value{VERSION} can be found at
-@url{ftp://prep.ai.mit.edu/gnu/wget/wget-@value{VERSION}.tar.gz}
+@url{ftp://ftp.gnu.org/pub/gnu/wget/wget-@value{VERSION}.tar.gz}
 
 @node Mailing List, Reporting Bugs, Distribution, Various
 @section Mailing List
@@ -3114,6 +3183,7 @@ Kristijan @v{C}onka@v{s},
 Kristijan Conkas,
 @end ifnottex
 John Daily,
+Ahmon Dancy,
 Andrew Davison,
 Andrew Deryabin,
 Ulrich Drepper,
@@ -3140,6 +3210,7 @@ Lemble Gregory,
 Hans Grobler,
 Mathieu Guillaume,
 Dan Harkless,
+Aaron Hawley,
 Herold Heiko,
 Jochen Hein,
 Karl Heuer,
@@ -3191,6 +3262,8 @@ Nicolas Lichtmeier,
 @end ifnottex
 Dave Love,
 Alexander V. Lukyanov,
+Thomas Lussnig,
+Aurelien Marchand,
 Jordan Mendelson,
 Lin Zhe Min,
 Tim Mooney,
@@ -3213,6 +3286,7 @@ Csaba R@'{a}duly,
 Csaba Raduly,
 @end ifnottex
 Keith Refson,
+Bill Richardson,
 Tyler Riddle,
 Tobias Ringstrom,
 @c Texinfo doesn't grok @'{@i}, so we have to use TeX itself.
@@ -3222,6 +3296,7 @@ Juan Jos\'{e} Rodr\'{\i}gues,
 @ifnottex
 Juan Jose Rodrigues,
 @end ifnottex
+Maciej W. Rozycki,
 Edward J. Sabol,
 Heinz Salzmann,
 Robert Schmidt,
@@ -3235,7 +3310,9 @@ John Summerfield,
 Szakacsits Szabolcs,
 Mike Thomas,
 Philipp Thomas,
+Mauro Tortonesi,
 Dave Turner,
+Gisle Vanem,
 Russell Vincent,
 Charles G Waldman,
 Douglas E. Wegscheid,