+
    f4jZU                        R t ^ RIt^ RIt^ RIt. R"OtRP
                  tRP
                  tRP
                  t ! R R]	4      t
]P                  ]P                  ,           R	,           t]R
,           t]! ]! R4      4      ]! ]! ]]4      4      ,
           U u/ uF  p V RV ,          bK  	  up t]P)                  ]! R4      R]! R4      R/4       ]P*                  ! R]P,                  ! ]4      ,          4      P.                  t]P*                  ! R4      tR tR t]P*                  ! R4      P8                  tR tR t. R#Ot . R$Ot!^ ] ]!3R lt" ! R R]#4      t$Rt%]%R,           t&]P*                  ! R]%,           R,           ]&,           R,           ]PN                  ]PP                  ,          4      t) ! R  R]#4      t* ! R! R]*4      t+R# u up i )%a%
  
Here's a sample session to show how to use this module.
At the moment, this is the only documentation.

The Basics
----------

Importing is easy...

   >>> from http import cookies

Most of the time you start by creating a cookie.

   >>> C = cookies.SimpleCookie()

Once you've created your Cookie, you can add values just as if it were
a dictionary.

   >>> C = cookies.SimpleCookie()
   >>> C["fig"] = "newton"
   >>> C["sugar"] = "wafer"
   >>> C.output()
   'Set-Cookie: fig=newton\r\nSet-Cookie: sugar=wafer'

Notice that the printable representation of a Cookie is the
appropriate format for a Set-Cookie: header.  This is the
default behavior.  You can change the header and printed
attributes by using the .output() function

   >>> C = cookies.SimpleCookie()
   >>> C["rocky"] = "road"
   >>> C["rocky"]["path"] = "/cookie"
   >>> print(C.output(header="Cookie:"))
   Cookie: rocky=road; Path=/cookie
   >>> print(C.output(attrs=[], header="Cookie:"))
   Cookie: rocky=road

The load() method of a Cookie extracts cookies from a string.  In a
CGI script, you would use this method to extract the cookies from the
HTTP_COOKIE environment variable.

   >>> C = cookies.SimpleCookie()
   >>> C.load("chips=ahoy; vienna=finger")
   >>> C.output()
   'Set-Cookie: chips=ahoy\r\nSet-Cookie: vienna=finger'

The load() method is darn-tootin smart about identifying cookies
within a string.  Escaped quotation marks, nested semicolons, and other
such trickeries do not confuse it.

   >>> C = cookies.SimpleCookie()
   >>> C.load('keebler="E=everybody; L=\\"Loves\\"; fudge=;";')
   >>> print(C)
   Set-Cookie: keebler="E=everybody; L=\"Loves\"; fudge=;"

Each element of the Cookie also supports all of the RFC 2109
Cookie attributes.  Here's an example which sets the Path
attribute.

   >>> C = cookies.SimpleCookie()
   >>> C["oreo"] = "doublestuff"
   >>> C["oreo"]["path"] = "/"
   >>> print(C)
   Set-Cookie: oreo=doublestuff; Path=/

Each dictionary element has a 'value' attribute, which gives you
back the value associated with the key.

   >>> C = cookies.SimpleCookie()
   >>> C["twix"] = "none for you"
   >>> C["twix"].value
   'none for you'

The SimpleCookie expects that all values should be standard strings.
Just to be sure, SimpleCookie invokes the str() builtin to convert
the value to a string, when the values are set dictionary-style.

   >>> C = cookies.SimpleCookie()
   >>> C["number"] = 7
   >>> C["string"] = "seven"
   >>> C["number"].value
   '7'
   >>> C["string"].value
   'seven'
   >>> C.output()
   'Set-Cookie: number=7\r\nSet-Cookie: string=seven'

Finis.
NCookieError
BaseCookieSimpleCookie z;  c                       ] tR t^tRtR# )r    N)__name__
__module____qualname____firstlineno____static_attributes__r       lib/python3.14/http/cookies.pyr   r      s    r   z!#$%&'*+-.^_`|~:z ()/<=>?@[]{}   z\%03o"z\"\z\\z[%s]+z[\x00-\x1F\x7F]c                 j    \         ;QJ d    R V  4       F  '       g   K   R# 	  R# ! R V  4       4      # )z`Detects control characters within a value.
Supports any type, as header values can be any type.
c              3   ^   "   T F#  p\         P                  \        V4      4      x  K%  	  R # 5iN)_control_character_researchstr).0vs   & r   	<genexpr>)_has_control_character.<locals>.<genexpr>   s#     AS$++CF33Ss   +-TF)any)vals   *r   _has_control_characterr      s-     3ASA33A3A3ASAAAr   c                v    V e   \        V 4      '       d   V # RV P                  \        4      ,           R,           # )zQuote a string for use in a cookie header.

If the string does not need to be double-quoted, then just return the
string.  Otherwise, surround the string in doublequotes and quote
(with a \) special characters.
r   )_is_legal_key	translate_Translatorr   s   &r   _quoter%      s1     {mC((
S]];//#55r   z\\(?:([0-3][0-7][0-7])|(.))c                 j    V ^,          '       d   \        \        V ^,          ^4      4      # V ^,          # )   )chrint)ms   &r   _unquote_replacer+      s)    tt3qtQ<  tr   c                     V e   \        V 4      ^8  d   V # V ^ ,          R8w  g   V R,          R8w  d   V # V ^R p \        \        V 4      # )Nr   )len_unquote_subr+   r$   s   &r   _unquoter0      sO     {c#hl

1v}B3
 a)C (#..r   c           	      |    ^ RI HpH p V! 4       pV! WP,           4      w	  rgrrrpRW,          WV,          WiW3,          # )    )gmtimetimez#%s, %02d %3s %4d %02d:%02d:%02d GMT)r4   r3   )futureweekdayname	monthnamer3   r4   nowyearmonthdayhhmmsswdyzs   &&&            r   _getdaterB      sE    !
&C-3CL-A*D""0OSE"2DbEF Fr   c                   V  a  ] tR t^t o RtRRRRRRRRR	R
RRRRRRRRRR/
t]P                  ]R4      t0 R*mt	R t
]R 4       t]R 4       t]R 4       tR tR+R ltR t]P&                  tR tR tR  tR! tR" tR# tR$ tR,R% lt]tR& tR+R' ltR+R( lt] ! ]!PD                  4      t#R)t$V t%R# )-Morsela/  A class to hold ONE (key, value) pair.

In a cookie, each such pair may have several attributes, so this class is
used to keep the attributes associated with the appropriate key,value pair.
This class also includes a coded_value attribute, which is used to hold
the network representation of the value.
expirespathPathcommentCommentdomainDomainmax-agezMax-AgesecureSecurehttponlyHttpOnlyversionVersionsamesiteSameSitepartitionedPartitionedr   c                n    R ;V n         ;V n        V n        \        P	                  W P
                  4       R # r   )_key_value_coded_valuedictupdate_reserved_defaultsselfs   &r   __init__Morsel.__init__  s,    6::	:DK$"3 	D112r   c                    V P                   # r   )rX   r^   s   &r   key
Morsel.key"  s    yyr   c                    V P                   # r   )rY   r^   s   &r   valueMorsel.value&  s    {{r   c                    V P                   # r   )rZ   r^   s   &r   coded_valueMorsel.coded_value*  s       r   c                    VP                  4       pWP                  9   g   \        R V: 24      h\        W4      '       d   \        RV: RV: 24      h\        P                  WV4       R# Invalid attribute .Control characters are not allowed in cookies r   N)lower	_reservedr   r   r[   __setitem__)r_   KVs   &&&r   rq   Morsel.__setitem__.  s\    GGINN";<<!!'' NqeSTUVTYZ[[!$r   Nc                    VP                  4       pWP                  9  d   \        R V: 24      h\        W4      '       d   \        RV: RV: 24      h\        P                  WV4      # )rm   rn   r   )ro   rp   r   r   r[   
setdefault)r_   rc   r   s   &&&r   rv   Morsel.setdefault6  sS    iiknn$=>>!#++WZ\_abbt#..r   c                *   \        V\        4      '       g   \        # \        P	                  W4      ;'       d\    V P
                  VP
                  8H  ;'       d;    V P                  VP                  8H  ;'       d    V P                  VP                  8H  # r   )
isinstancerD   NotImplementedr[   __eq__rY   rX   rZ   r_   morsels   &&r   r{   Morsel.__eq__>  sz    &&))!!D) 9 9v}},9 9		V[[(9 9 !!V%8%88	:r   c                    \        4       p\        P                  W4       VP                  P                  V P                  4       V# r   )rD   r[   r\   __dict__r|   s   & r   copyMorsel.copyH  s0    F!t}}-r   c                &   / p\        V4      P                  4        F\  w  r4VP                  4       pW0P                  9  d   \	        R V: 24      h\        W44      '       d   \	        RV: RV: 24      hWBV&   K^  	  \         P                  W4       R# rl   )r[   itemsro   rp   r   r   r\   )r_   valuesdatarc   r   s   &&   r   r\   Morsel.updateN  s    V**,HC))+C..(!C"ABB%c//! #--0G1SG#= > >I - 	Dr   c                (    V P                  V4       V # r   )r\   )r_   r   s   &&r   __ior__Morsel.__ior__Z  s    Fr   c                <    VP                  4       V P                  9   # r   )ro   rp   )r_   rr   s   &&r   isReservedKeyMorsel.isReservedKey^  s    wwyDNN**r   c                   VP                  4       V P                  9   d   \        R V: 24      h\        V4      '       g   \        RV: 24      h\	        WV4      '       d   \        RV: RV: RV: 24      hWn        W n        W0n        R# )zAttempt to set a reserved key zIllegal key rn   r   N)ro   rp   r   r!   r   rX   rY   rZ   )r_   rc   r   	coded_vals   &&&&r   set
Morsel.seta  su    99;$..(CIJJS!!#788!#I66LOQTV_ac c 	%r   c                N    R V P                   RV P                  RV P                  /# )rc   rf   ri   )rX   rY   rZ   r^   s   &r   __getstate__Morsel.__getstate__o  s)    499T[[4,,
 	
r   c                    VR ,          pVR,          pVR,          p\        W#V4      '       d   \        RV: RV: RV: 24      hW n        W0n        W@n        R# )rc   rf   ri   rn   r   N)r   r   rX   rY   rZ   )r_   staterc   rf   ri   s   &&   r   __setstate__Morsel.__setstate__v  sd    ElgM*!#k::N!$q	;/C D D	'r   c                2    V: R V P                  V4      : 2# )r   )OutputString)r_   attrsheaders   &&&r   outputMorsel.output  s     $"3"3E":;;r   c                \    R V P                   P                  : RV P                  4       : R2# )<: >)	__class__r	   r   r^   s   &r   __repr__Morsel.__repr__  s     !^^44d6G6G6IJJr   c                    ^ RI pV P                  V4      p\        V4      '       d   \        R4      hVP                  P                  VRRR7      pRV: R2# )r2   N-Control characters are not allowed in cookiesr   zutf-8)safeencodingzq
        <script type="text/javascript">
        <!-- begin hiding
        document.cookie = decodeURIComponent("z8");
        // end hiding -->
        </script>
        )urllib.parser   r   r   parsequote)r_   r   urlliboutput_stringoutput_encodeds   &&   r   	js_outputMorsel.js_output  sX    ))%0!-00MNN  ++MW+U   	 r   c                j   . pVP                   pV! V P                  : R V P                  : 24       Vf   V P                  p\	        V P                  4       4      pV EFH  w  rVVR8X  d   K  WQ9  d   K  VR8X  dB   \        V\        4      '       d,   V! V P                  V,          : R \        V4      : 24       K_  VR8X  d;   \        V\        4      '       d%   V! RV P                  V,          V3,          4       K  VR8X  dB   \        V\        4      '       d,   V! V P                  V,          : R \        V4      : 24       K  WPP                  9   d1   V'       d&   V! \        V P                  V,          4      4       EK%  EK(  V! V P                  V,          : R V: 24       EKK  	  \        V4      # )=r   rE   rL   z%s=%drH   )appendrc   ri   rp   sortedr   ry   r)   rB   r   r%   _flags_semispacejoin)r_   r   resultr   r   rc   rf   s   &&     r   r   Morsel.OutputString  sK     	$((D$4$456 =NNEtzz|$JC{iJuc$:$:$.."5"5xGH	!j&<&<w$.."5u!==>	!j&<&<$.."5"5ve}EF#3t~~c234  $.."5"5u=>  $ f%%r   )rZ   rX   rY   >   rM   rO   rU   r   )NSet-Cookie:)&r	   r
   r   r   __doc__rp   r[   fromkeysr]   r   r`   propertyrc   rf   ri   rq   rv   r{   object__ne__r   r\   r   r   r   r   r   r   __str__r   r   r   classmethodtypesGenericAlias__class_getitem__r   __classdictcell____classdict__s   @r   rD   rD      s    * 	YVYXYXZYZ}I y"52F3     ! !%/: ]]F
 +&
	(< GK "&B $E$6$67r   rD   z,\w\d!#%&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\=z\[\]z
    \s*                            # Optional whitespace at start of cookie
    (?P<key>                       # Start of group 'key'
    [ax  ]+?   # Any word of at least one letter
    )                              # End of group 'key'
    (                              # Optional group: there may not be a value.
    \s*=\s*                          # Equal Sign
    (?P<val>                         # Start of group 'val'
    "(?:[^\\"]|\\.)*"                  # Any double-quoted string
    |                                  # or
    # Special case for "expires" attr
    (\w{3,6}day|\w{3}),\s              # Day of the week or abbreviated day
    [\w\d\s-]{9,11}\s[\d:]{8}\sGMT     # Date and time in specific format
    |                                  # or
    [a-  ]*      # Any word or empty string
    )                                # End of group 'val'
    )?                             # End of optional value group
    \s*                            # Any number of spaces.
    (\s+|;|$)                      # Ending either at space, semicolon, or EOS.
    c                   v   a  ] tR tRt o RtR tR tRR ltR tR t	RR	 lt
]
tR
 tRR ltR t]3R ltRtV tR# )r   i  z'A container class for a set of Morsels.c                    W3# )zreal_value, coded_value = value_decode(STRING)
Called prior to setting a cookie's value from the network
representation.  The VALUE is the value read from HTTP
header.
Override this function to modify the behavior of cookies.
r   r_   r   s   &&r   value_decodeBaseCookie.value_decode  s     xr   c                    \        V4      pW"3# )zreal_value, coded_value = value_encode(VALUE)
Called prior to setting a cookie's value from the dictionary
representation.  The VALUE is the value being assigned.
Override this function to modify the behavior of cookies.
r$   r_   r   strvals   && r   value_encodeBaseCookie.value_encode  s     S~r   Nc                <    V'       d   V P                  V4       R # R # r   )load)r_   inputs   &&r   r`   BaseCookie.__init__  s    IIe r   c                    V P                  V\        4       4      pVP                  WV4       \        P	                  WV4       R# )z+Private method for setting a cookie's valueN)getrD   r   r[   rq   )r_   rc   
real_valueri   Ms   &&&& r   __setBaseCookie.__set  s2    HHS&(#	c{+A&r   c                    \        V\        4      '       d   \        P                  WV4       R# V P	                  V4      w  r4V P                  WV4       R# )zDictionary style assignment.N)ry   rD   r[   rq   r   _BaseCookie__set)r_   rc   rf   rvalcvals   &&&  r   rq   BaseCookie.__setitem__  s?    eV$$T.**51JDJJs$'r   c                    . p\        V P                  4       4      pV FC  w  rgVP                  W4      p\        V4      '       d   \	        R4      hVP                  V4       KE  	  VP                  V4      # )z"Return a string suitable for HTTP.r   )r   r   r   r   r   r   join)	r_   r   r   sepr   r   rc   rf   value_outputs	   &&&&     r   r   BaseCookie.output
  se    tzz|$JC <<6L%l33!"QRRMM,'	  
 xxr   c                    . p\        V P                  4       4      pV F0  w  r4VP                  V: R \        VP                  4      : 24       K2  	  RV P
                  P                  : R\        V4      : R2# )r   r   r   r   )r   r   r   reprrf   r   r	   
_spacejoin)r_   lr   rc   rf   s   &    r   r   BaseCookie.__repr__  sV    tzz|$JCHHT%++%678  !^^44jmDDr   c                    . p\        V P                  4       4      pV F%  w  rEVP                  VP                  V4      4       K'  	  \	        V4      # )z(Return a string suitable for JavaScript.)r   r   r   r   	_nulljoin)r_   r   r   r   rc   rf   s   &&    r   r   BaseCookie.js_output  sC    tzz|$JCMM%//%01    r   c                    \        V\        4      '       d   V P                  V4       R# VP                  4        F	  w  r#W0V&   K  	  R# )zLoad cookies from a string (presumably HTTP_COOKIE) or
from a dictionary.  Loading cookies from a dictionary 'd'
is equivalent to calling:
    map(Cookie.__setitem__, d.keys(), d.values())
N)ry   r   _BaseCookie__parse_stringr   )r_   rawdatarc   rf   s   &&  r   r   BaseCookie.load&  sB     gs##(
 	 &mmo
!S	 .r   c                T   ^ p\        V4      p. pRp^p^p^ Tu;8:  d	   V8  Ed=   M EM8VP                  W4      p	V	'       g   EMV	P                  R4      V	P                  R4      rV	P                  ^ 4      pV
^ ,          R8X  d'   V'       g   Ky  VP	                  WzR,          V34       K  V
P                  4       \        P                  9   dh   V'       g   R# Vf;   V
P                  4       \        P                  9   d   VP	                  WzR34       K  R# VP	                  Wz\        V4      34       EK  Ve(   VP	                  WV P                  V4      34       RpEKJ  R# RpV F>  w  rpW8X  d   Vf   Q hWV
&   K  W8X  g   Q hVw  rV P                  WV4       W
,          pK@  	  R# )r2   Frc   r   $:r'   NNNT)r.   matchgroupendr   ro   rD   rp   r   r0   r   r   )r_   r   pattinparsed_itemsmorsel_seenTYPE_ATTRIBUTETYPE_KEYVALUEr   rc   rf   r   tpr   r   s   &&&             r   __parse_stringBaseCookie.__parse_string4  sy   H
 1jqjjJJs&EU+U[[-?		!A1v}" ##^We$DE 0 00"=yy{fmm3$++^$,GH  ''huo(NO"##]9J9J59Q$RS"  *NBU#}$}#***"


3d+I +r   r   r   )Nr   z
)r	   r
   r   r   r   r   r   r`   r   rq   r   r   r   r   r   _CookiePatternr   r   r   r   s   @r   r   r     sL     1'(	  GE! (6 : :r   c                   0   a  ] tR tRt o RtR tR tRtV tR# )r   iq  z
SimpleCookie supports strings as cookie values.  When setting
the value using the dictionary assignment notation, SimpleCookie
calls the builtin str() to convert the value to a string.  Values
received from HTTP are kept as strings.
c                    \        V4      V3# r   )r0   r   s   &&r   r   SimpleCookie.value_decodex  s    }c!!r   c                2    \        V4      pV\        V4      3# r   )r   r%   r   s   && r   r   SimpleCookie.value_encode{  s    Svf~%%r   r   N)	r	   r
   r   r   r   r   r   r   r   r   s   @r   r   r   q  s     "& &r   )r   r   r   )MonTueWedThuFriSatSun)NJanFebMarAprMayJunJulAugSepOctNovDec),r   restringr   __all__r   r   r   r   	Exceptionr   ascii_lettersdigits_LegalChars_UnescapedCharsr   rangemapordr#   r\   compileescape	fullmatchr!   r   r   r%   subr/   r+   r0   _weekdayname
_monthnamerB   r[   rD   _LegalKeyChars_LegalValueCharsASCIIVERBOSEr  r   r   )r   s   0r   <module>r/     s  NXz 
  
7GG	XX

	) 	" ""V]]25GG/ E#J#c#.G*HHJH1 (Q,HJ   HeIv 
 

7RYY{%;;<FF

#56 B
6 zz89==/6 A8
 <: FF8T F8d B!G+  	 		 & 
BJJ	' 2L L^&: &YJs   F?