1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] More documentation for --load-cookies.

This commit is contained in:
hniksic 2001-12-08 12:14:00 -08:00
parent 7474c84c7b
commit 75fcce81a4
2 changed files with 37 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2001-12-08 Hrvoje Niksic <hniksic@arsdigita.com>
* wget.texi (HTTP Options): Provide more specific information
about how --load-cookies is meant to be used.
2001-12-08 Hrvoje Niksic <hniksic@arsdigita.com> 2001-12-08 Hrvoje Niksic <hniksic@arsdigita.com>
* texi2pod.pl: Include the EXAMPLES section. * texi2pod.pl: Include the EXAMPLES section.

View File

@ -880,6 +880,35 @@ Load cookies from @var{file} before the first HTTP retrieval. The
format of @var{file} is one used by Netscape and Mozilla, at least their format of @var{file} is one used by Netscape and Mozilla, at least their
Unix version. Unix version.
You will typically use this option when mirroring sites that require
that you be logged in to access some or all of their content. The login
process typically works by the web server issuing an @sc{http} cookie
upon receiving and verifying your credentials. The cookie is then
resent by the browser when accessing that part of the site, and so
proves your identity.
Mirroring such a site requires Wget to send the same cookies your
browser sends when communicating with the site. This is achieved by
@samp{--load-cookies}---simply point Wget to the location of the
@file{cookies.txt} file, and it will send the same cookies your browser
would send in the same situation. If you're using Netscape navigator,
specify @samp{--load-cookies ~/.netscape/cookies.txt}. Mozilla keeps
the cookies file somewhere under @file{~/.mozilla}, in the profile
directory, but it's also named @file{cookies.txt}, the full path usually
being @file{~/.mozilla/default/@var{some-weird-string}/cookies.txt}.
If you're using Wget under a non-Unix OS, or if you are using a
different browser, @samp{--load-cookies} will not work.
In that case you can view the cookies using the cookie manager provided
by your browser, and write down the name and value of the cookie needed
for the site. Then you can bypass the ``official'' cookie code and
simply tell Wget to use that one cookie, like this:
@example
wget --cookies=off --header "Cookie: @var{name}=@var{value}"
@end example
@cindex saving cookies @cindex saving cookies
@cindex cookies, saving @cindex cookies, saving
@item --save-cookies @var{file} @item --save-cookies @var{file}
@ -2334,9 +2363,9 @@ wget -r -l2 -P/tmp ftp://wuarchive.wustl.edu/
@item @item
You want to download all the @sc{gif}s from a directory on an @sc{http} You want to download all the @sc{gif}s from a directory on an @sc{http}
server. @samp{wget http://www.server.com/dir/*.gif} doesn't work server. You tried @samp{wget http://www.server.com/dir/*.gif}, but that
because @sc{http} retrieval does not support globbing. In that case, didn't work because @sc{http} retrieval does not support globbing. In
use: that case, use:
@example @example
wget -r -l1 --no-parent -A.gif http://www.server.com/dir/ wget -r -l1 --no-parent -A.gif http://www.server.com/dir/
@ -2430,7 +2459,6 @@ Or, with less typing:
wget -m -k -K -E http://www.gnu.org/ -o /home/me/weeklog wget -m -k -K -E http://www.gnu.org/ -o /home/me/weeklog
@end example @end example
@end itemize @end itemize
@c man end @c man end
@node Various, Appendices, Examples, Top @node Various, Appendices, Examples, Top