> I actually do know the cookies that are set. What I'd
> like to do is add it to cookies.txt. I attempted to
> edit the file, but when I load the cookies, the ones
> I've added doesn't show. It only shows the ones saved
> by wget. I'm not even sure what the format of the
> cookies is supposed to be.

Note that some browsers (not IE though) save their cookies in a
plain-text cookies file so nothing prevents you from also pointing
directly to, say, Firefox's cookies file, e.g. (this is on Windows but
using cygwin):

wget \
  --load-cookies /cygdrive/c/Documents\ and\
Settings/someuser/Application\
Data/Mozilla/Firefox/Profiles/99jf7fti.default/cookies.txt \
  "http://www.yourtargetwebsite.com";

Even if you don't use that file, examining it and pointing to it is very
informative for understanding what the cookies look like.

> > Permanent cookies are supposed
> > to be present in
> > cookies.txt, and Wget will use them.  Session
> > cookies will be missing
> > (regardless of how they were set) from the file and
> > therefore will not be picked up by Wget.

This is not entirely true. You can use "--keep-session-cookies" and save
the session cookies as well as the regular cookies for reuse by
subsequent wget calls, e.g., supposing you have a site that sets a
session cookie after an authenticated login:

wget \
  --save-cookies cookies.txt \
  --keep-session-cookies \
  --post-data '[EMAIL PROTECTED]&password=your_password'
\
  "http://www.yourtargetwebsite.com/login_page";

After this your wget invocations can use the cookies.txt and you will be
a logged in user.

George


Reply via email to