Python Standard Library

Table of Contents

  • Ch 01 - 10
  • Ch 11 - 20
  • Ch 21 - 30
  • Ch 31 - 37
  • api
    • 06 Built-in Exceptions
    • 07 String Services
    • 08 Data Types
    • 09 Numeric and Mathematical Methods
    • 10 File and Directory Access
    • 11 Data Persistence
    • 12 Data Compression and Archiving
    • 13 File Formats
    • 14 Cryptographic Services
    • 15 Generic Operating System Services
    • 16 Optional Operating System Services
    • 17 Interprocess Communication and Networking
    • 18 Internet Data Handling
    • 19 Structured Markup Processing Tools
    • 20 Internet Protocols and Support
      • webbrowser
      • cgi
      • cgitb
      • wsgiref
      • urllib
      • urllib2
      • httplib
      • ftplib
      • poplib
      • imaplib
      • nntplib
      • smtplib
      • smtpd
      • telnetlib
      • uuid
      • urlparse
      • SocketServer
      • BaseHTTPServer
      • SimpleHTTPServer
      • CGIHTTPServer
      • cookielib
        • Functions
        • Classes
          • cookielib.Absent
          • cookielib.Cookie
            • Methods
              • cookielib.Cookie.__init__
              • cookielib.Cookie.__repr__
              • cookielib.Cookie.__str__
              • cookielib.Cookie.get_nonstandard_attr
              • cookielib.Cookie.has_nonstandard_attr
              • cookielib.Cookie.is_expired
              • cookielib.Cookie.set_nonstandard_attr
          • cookielib.CookieJar
          • cookielib.CookiePolicy
          • cookielib.DefaultCookiePolicy
          • cookielib.FileCookieJar
          • cookielib.LWPCookieJar
          • cookielib.MozillaCookieJar
        • Exceptions
      • Cookie
      • xmlrpclib
      • SimpleXMLRPCServer
      • DocXMLRPCServer
    • 21 Multimedia Services
    • 22 Internationalization
    • 23 Program Frameworks
    • 24 Graphical User Interfaces with Tk
    • 25 Development Tools
    • 26 Debugging and Profiling
    • 27 Software Packaging and Distribution
    • 28 Python Runtime Services
    • 29 Custom Python Interpreters
    • 30 Restricted Execution
    • 31 Importing Modules
    • 32 Python Language Services
    • 33 (depr) Python compiler package
    • 34 Miscellaneous Services
    • 35 MS Windows Specific Services
    • 36. Unix Specific Services
    • 37 Mac OS X specific services
Python Standard Library
  • Docs »
  • api »
  • cookielib »
  • cookielib.Cookie
  • View page source

cookielib.Cookie¶

class cookielib.Cookie(version, name, value, port, port_specified, domain, domain_specified, domain_initial_dot, path, path_specified, secure, expires, discard, comment, comment_url, rest, rfc2109=False)[source]¶

HTTP Cookie.

This class represents both Netscape and RFC 2965 cookies.

This is deliberately a very simple class. It just holds attributes. It’s possible to construct Cookie instances that don’t comply with the cookie standards. CookieJar.make_cookies is the factory function for Cookie objects – it deals with cookie parsing, supplying defaults, and normalising to the representation used in this class. CookiePolicy is responsible for checking them to see whether they should be accepted from and returned to the server.

Note that the port may be present in the headers, but unspecified (“Port” rather than”Port=80”, for example); if this is the case, port is None.

Methods¶

__init__(version, name, value, port, ...[, ...])
__repr__()
__str__()
get_nonstandard_attr(name[, default])
has_nonstandard_attr(name)
is_expired([now])
set_nonstandard_attr(name, value)
Next Previous

© Copyright 2016.

Built with Sphinx using a theme provided by Read the Docs.