0

I would like to implement what is shown here:

Login to website using urllib2 - Python 2.7

My question is why is cookielib and cookiejar needed in the code? Why will the code not work without cookielib and cookiejar?

Thank you.

Community
  • 1
  • 1
Ashley
  • 1
  • 1

1 Answers1

0

When you log in to a website, they usually give you a "cookie". When you load another page from the same site, you can show them this cookie to let them know who you are.

The cookie jar is a data structure that manages this for you.

Without it, you could not stay logged in.

Thilo
  • 257,207
  • 101
  • 511
  • 656