Creates a new #SoupCookie with the given attributes.
Use soup.cookie.Cookie.setSecure and soup.cookie.Cookie.setHttpOnly if you need to set those attributes on the returned cookie.
If domain starts with ".", that indicates a domain (which matches the string after the ".", or any hostname that has domain as a suffix). Otherwise, it is a hostname and must match exactly.
max_age is used to set the "expires" attribute on the cookie; pass -1 to not include the attribute (indicating that the cookie expires with the current session), 0 for an already-expired cookie, or a lifetime in seconds. You can use the constants soup.types.COOKIE_MAX_AGE_ONE_HOUR, soup.types.COOKIE_MAX_AGE_ONE_DAY, soup.types.COOKIE_MAX_AGE_ONE_WEEK and soup.types.COOKIE_MAX_AGE_ONE_YEAR (or multiples thereof) to calculate this value. (If you really care about setting the exact time that the cookie will expire, use soup.cookie.Cookie.setExpires.)
As of version 3.4.0 the default value of a cookie's same-site-policy is soup.types.SameSitePolicy.Lax.
cookie name
cookie value
cookie domain or hostname
cookie path, or null
max age of the cookie, or -1 for a session cookie
a new #SoupCookie.
Creates a new #SoupCookie with the given attributes.
Use soup.cookie.Cookie.setSecure and soup.cookie.Cookie.setHttpOnly if you need to set those attributes on the returned cookie.
If domain starts with ".", that indicates a domain (which matches the string after the ".", or any hostname that has domain as a suffix). Otherwise, it is a hostname and must match exactly.
max_age is used to set the "expires" attribute on the cookie; pass -1 to not include the attribute (indicating that the cookie expires with the current session), 0 for an already-expired cookie, or a lifetime in seconds. You can use the constants soup.types.COOKIE_MAX_AGE_ONE_HOUR, soup.types.COOKIE_MAX_AGE_ONE_DAY, soup.types.COOKIE_MAX_AGE_ONE_WEEK and soup.types.COOKIE_MAX_AGE_ONE_YEAR (or multiples thereof) to calculate this value. (If you really care about setting the exact time that the cookie will expire, use soup.cookie.Cookie.setExpires.)
As of version 3.4.0 the default value of a cookie's same-site-policy is soup.types.SameSitePolicy.Lax.