+
    TjTB                         ^ RI t ^ RIt^ RIHtHt ^ RIHt ^ RIHt ^ RIH	t	 ^ RI
Ht ^ RIHt ^ RIHt ]P                   ]P"                  ,           t ! R	 R
]4      t ! R R]4      t ! R R4      tR# )    N)datetime	timedelta)sync_to_async)settings)signing)timezone)get_random_string)import_stringc                       ] tR t^tRtRtR# )CreateErrorz{
Used internally as a consistent exception type to catch from save (see the
docstring for SessionBase.save() for details).
 N__name__
__module____qualname____firstlineno____doc____static_attributes__r       Z/var/www/idalgo/venv/lib/python3.14/site-packages/django/contrib/sessions/backends/base.pyr   r      s    
 	r   r   c                       ] tR t^tRtRtR# )UpdateErrorz>
Occurs if Django tries to update a session that was deleted.
r   Nr   r   r   r   r   r      s     	r   r   c                   L  a  ] tR t^#t o RtRtRt]! 4       tRIR lt	R t
R tR tR	 tR
 t]R 4       tRIR ltRIR lt]3R lt]3R ltR tR tR tR tR tR tR tR tR tR tR tR t R t!R t"R t#R t$R  t%R! t&R" t'R# t(R$ t)R% t*R& t+R' t,R( t-R) t.R* t/R+ t0R, t1]! ]04      t2]! ]0]14      t3RJR- lt4RJR. lt5]! ]44      t6R/ t7R0 t8R1 t9R2 t:R3 t;R4 t<R5 t=R6 t>R7 t?R8 t@R9 tAR: tBR; tCR< tDR= tER> tFR? tGRJR@ ltHRJRA ltIRIRB ltJRIRC ltKRD tLRE tM]NRF 4       tO]NRG 4       tPRHtQV tRR# )KSessionBasez%
Base class for all Session classes.

testcookieworkedNc                j    Wn         R V n        R V n        \        \        P
                  4      V n        R# )FN)_session_keyaccessedmodifiedr
   r   SESSION_SERIALIZER
serializerselfsession_keys   &&r   __init__SessionBase.__init__-   s(    ''(C(CDr   c                    WP                   9   # N_sessionr$   keys   &&r   __contains__SessionBase.__contains__3       mm##r   c                (    V P                   V,          # r)   r*   r,   s   &&r   __getitem__SessionBase.__getitem__6   s    }}S!!r   c                0    W P                   V&   R V n        R# TNr+   r    r$   r-   values   &&&r   __setitem__SessionBase.__setitem__9   s    "cr   c                T   "   Y P                  4       G R j  xL
 V&   RV n        R #  L5iNT)_aget_sessionr    r7   s   &&&r   asetSessionBase.aset=   s%     ,1!!#	#S) 
$s   (&(c                .    V P                   V R V n        R# r5   r6   r,   s   &&r   __delitem__SessionBase.__delitem__A   s    MM#r   c                <    R V P                   P                  ,           # )zdjango.contrib.sessions.)	__class__r   r$   s   &r   key_saltSessionBase.key_saltE   s    )DNN,G,GGGr   c                8    V P                   P                  W4      # r)   )r+   getr$   r-   defaults   &&&r   rI   SessionBase.getI   s    }}  ..r   c                \   "   V P                  4       G R j  xL
 P                  W4      #  L5ir)   )r=   rI   rJ   s   &&&r   agetSessionBase.agetL   s%     ((**//==*s   ,*,c                    V P                   ;'       g    WP                  9   V n         W P                  J d   RMV3pV P                  P                  ! V.VO5!  # Nr   )r    r+   _SessionBase__not_givenpopr$   r-   rK   argss   &&& r   rS   SessionBase.popO   sJ    ==)= 0 00rwj}}  ,t,,r   c                   "   V P                   ;'       g    YP                  4       G R j  xL
 9   V n         W P                  J d   RMV3pV P                  4       G R j  xL
 P                  ! V.VO5!  #  LI L5irQ   )r    r=   rR   rS   rT   s   &&& r   apopSessionBase.apopT   sf     LL7I7I7K1K)L 0 00rwj((**//;d;; 2L*s!   (A8A42A8A6A86A8c                T    WP                   9   d   V P                   V,          # W V&   V# r)   r*   r7   s   &&&r   
setdefaultSessionBase.setdefaultY   s'    --==%%ILr   c                   "   V P                  4       G R j  xL
 pW9   d	   W1,          # V P                  W4      G R j  xL
  V#  L- L5ir)   )r=   r>   )r$   r-   r8   sessions   &&& r   asetdefaultSessionBase.asetdefault`   sD     **,,><))C'''L - (s   AA&AAAAc                6    V P                   W P                  &   R # r)   )TEST_COOKIE_VALUETEST_COOKIE_NAMErE   s   &r   set_test_cookieSessionBase.set_test_cookieh   s    &*&<&<""#r   c                n   "   V P                  V P                  V P                  4      G R j  xL
  R #  L5ir)   )r>   rc   rb   rE   s   &r   aset_test_cookieSessionBase.aset_test_cookiek   s%     ii--t/E/EFFFs   *535c                R    V P                  V P                  4      V P                  8H  # r)   )rI   rc   rb   rE   s   &r   test_cookie_workedSessionBase.test_cookie_workedn   s"    xx--.$2H2HHHr   c                n   "   V P                  V P                  4      G R j  xL
 V P                  8H  #  L5ir)   )rN   rc   rb   rE   s   &r   atest_cookie_workedSessionBase.atest_cookie_workedq   s+     ii 5 5664;Q;QQQ6s   535c                    W P                    R # r)   )rc   rE   s   &r   delete_test_cookieSessionBase.delete_test_cookiet   s    &&'r   c                X   "   V P                  4       G R j  xL
 V P                   R #  L5ir)   )r=   rc   rE   s   &r   adelete_test_cookieSessionBase.adelete_test_cookiew   s"     %%'')>)>?'s   *(*c                ^    \         P                  ! VV P                  V P                  RR7      # )zI
Return the given session dictionary serialized and encoded as a string.
T)saltr"   compress)r   dumpsrF   r"   )r$   session_dicts   &&r   encodeSessionBase.encodez   s)     }}	
 	
r   c                     \         P                  ! WP                  V P                  R 7      #   \         P                   d,    \
        P                  ! R4      pTP                  R4        / # \         d     / # i ; i))rv   r"   z!django.security.SuspiciousSessionzSession data corrupted)	r   loadsrF   r"   BadSignaturelogging	getLoggerwarning	Exception)r$   session_dataloggers   && r   decodeSessionBase.decode   su    
	====T__  ## 	5&&'JKFNN34
 		  	 			s   +. <A;-A;6A;:A;c                J    V P                   P                  V4       R V n        R# r5   )r+   updater    r$   dict_s   &&r   r   SessionBase.update   s    U#r   c                n   "   V P                  4       G R j  xL
 P                  V4       RV n        R #  L5ir<   )r=   r   r    r   s   &&r   aupdateSessionBase.aupdate   s+     !!#	#++E2 
$s   535c                    WP                   9   # r)   r*   r,   s   &&r   has_keySessionBase.has_key   r0   r   c                B   "   YP                  4       G R j  xL
 9   #  L5ir)   )r=   r,   s   &&r   ahas_keySessionBase.ahas_key   s     //11221s   c                6    V P                   P                  4       # r)   )r+   keysrE   s   &r   r   SessionBase.keys   s    }}!!##r   c                Z   "   V P                  4       G R j  xL
 P                  4       #  L5ir)   )r=   r   rE   s   &r   akeysSessionBase.akeys   s#     ((**0022*   +)+c                6    V P                   P                  4       # r)   )r+   valuesrE   s   &r   r   SessionBase.values   s    }}##%%r   c                Z   "   V P                  4       G R j  xL
 P                  4       #  L5ir)   )r=   r   rE   s   &r   avaluesSessionBase.avalues   s#     ((**2244*r   c                6    V P                   P                  4       # r)   )r+   itemsrE   s   &r   r   SessionBase.items   s    }}""$$r   c                Z   "   V P                  4       G R j  xL
 P                  4       #  L5ir)   )r=   r   rE   s   &r   aitemsSessionBase.aitems   s#     ((**1133*r   c                0    / V n         R V n        R V n        R# r5   )_session_cacher   r    rE   s   &r   clearSessionBase.clear   s     !r   c                |     V P                   '       * ;'       d    V P                  '       * #   \         d     R# i ; i)zBReturn True when there is no session_key and the session is empty.T)r   r   AttributeErrorrE   s   &r   is_emptySessionBase.is_empty   s9    	(((DD1D1D-DD 		s   , , ;;c                Z     \        ^ \        4      pV P                  V4      '       d   K*  V# )z)Return session key that isn't being used.)r	   VALID_KEY_CHARSexistsr#   s   & r   _get_new_session_key SessionBase._get_new_session_key   s&    +B@K;;{++""r   c                v   "    \        ^ \        4      pV P                  V4      G Rj  xL
 '       d   K2  V#  L5ir5   )r	   r   aexistsr#   s   & r   _aget_new_session_key!SessionBase._aget_new_session_key   s4     +B@Kk2222"" 3s   &9799c                `    V P                   f   V P                  4       V n         V P                   # r)   )r   r   rE   s   &r   _get_or_create_session_key&SessionBase._get_or_create_session_key   s+    $ $ 9 9 ;D   r   c                |   "   V P                   f   V P                  4       G R j  xL
 V n         V P                   #  L5ir)   )r   r   rE   s   &r   _aget_or_create_session_key'SessionBase._aget_or_create_session_key   s7     $&*&@&@&B BD    !Cs   "<:<c                2    T;'       d    \        V4      ^8  # )z|
Key must be truthy and at least 8 characters long. 8 characters is an
arbitrary lower bound for some minimal key security.
)lenr,   s   &&r   _validate_session_key!SessionBase._validate_session_key   s    
 $$s3x1}$r   c                    V P                   # r)   )_SessionBase__session_keyrE   s   &r   _get_session_keySessionBase._get_session_key   s    !!!r   c                R    V P                  V4      '       d	   Wn        R# RV n        R# )zF
Validate session key on assignment. Invalid values will set to None.
N)r   r   r$   r8   s   &&r   _set_session_keySessionBase._set_session_key   s#     %%e,,!&!%Dr   c                    RV n          V P                  #   \         dN    T P                  e	   T'       d   / T n         T P                  # T P	                  4       T n         T P                  # i ; i)z
Lazily load session from storage (unless "no_load" is True, when only
an empty dict is stored) and store it in the current instance.
T)r   r   r   r%   loadr$   no_loads   &&r   _get_sessionSessionBase._get_session   sk    
 	2&&& 	2'7&(# """ '+iik#"""	2s     A-A-
A-,A-c                   "   R V n          V P                  #   \         dW    T P                  e	   T'       d   / T n         T P                  # T P	                  4       G Rj  xL 
 T n         T P                  # i ; i5ir5   )r   r   r   r%   aloadr   s   &&r   r=   SessionBase._aget_session   sq     	9&&& 	9'7&(# """ -1JJL&8&8#"""	9sA   A; A; A8A8A;A8A" 
A8*A;7A88A;c                "    \         P                  # r)   )r   SESSION_COOKIE_AGErE   s   &r   get_session_cookie_age"SessionBase.get_session_cookie_age  s    ***r   c                    VR,          p VR,          pV'       g   V P	                  4       # \        V\        \        34      '       g   V# \        V\        4      '       d   \        P                  ! V4      pW2,
          pVP                  R,          VP                  ,           #   \          d    \        P                  ! 4       p Li ; i  \          d    T P                  R4      p Li ; i)zGet the number of seconds until the session expires.

Optionally, this function accepts `modification` and `expiry` keyword
arguments specifying the modification and expiry of the session.
modificationexpiry_session_expiryQ )KeyErrorr   nowrI   r   
isinstancer   strfromisoformatdayssecondsr$   kwargsr   r   deltas   &,   r   get_expiry_ageSessionBase.get_expiry_age  s    	*!.1L	1H%F ..00&8S/22Mfc""++F3F%zzE!EMM11#  	*#<<>L	*  	1XX/0F	1s"   	B# 	C	 # CC	C('C(c                  "    VR ,          p VR,          pV'       g   V P	                  4       # \        V\        \        34      '       g   V# \        V\        4      '       d   \        P                  ! V4      pW2,
          pVP                  R,          VP                  ,           #   \          d    \        P                  ! 4       p Li ; i  \          d    T P                  R4      G Rj  xL 
 p Li ; i5i)r   r   r   Nr   )r   r   r   rN   r   r   r   r   r   r   r   r   s   &,   r   aget_expiry_ageSessionBase.aget_expiry_age)  s     	*!.1L	8H%F ..00&8S/22Mfc""++F3F%zzE!EMM11  	*#<<>L	*  	899%6777F	8sV   C6	B% 	C C6BC6% CC6CC6C3*C-+C30C62C33C6c                    VR,          p VR,          p\	        V\
        4      '       d   V# \	        V\        4      '       d   \
        P                  ! V4      # T;'       g    V P                  4       pV\        VR7      ,           #   \          d    \        P                  ! 4       p Li ; i  \          d    T P                  R4      p Li ; i)zGet session the expiry date (as a datetime object).

Optionally, this function accepts `modification` and `expiry` keyword
arguments specifying the modification and expiry of the session.
r   r   r   r   )
r   r   r   rI   r   r   r   r   r   r   r$   r   r   r   s   &,  r   get_expiry_dateSessionBase.get_expiry_date<  s    	*!.1L	1H%F fh''M$$))&11884668i777  	*#<<>L	*
  	1XX/0F	1s"   	B 	B,  B)(B),C
Cc                  "    VR ,          p VR,          p\	        V\
        4      '       d   V# \	        V\        4      '       d   \
        P                  ! V4      # T;'       g    V P                  4       pV\        VR7      ,           #   \          d    \        P                  ! 4       p Li ; i  \          d    T P                  R4      G Rj  xL 
 p Li ; i5i)r   r   r   Nr   )
r   r   r   rN   r   r   r   r   r   r   r   s   &,  r   aget_expiry_dateSessionBase.aget_expiry_dateS  s     	*!.1L	8H%F fh''M$$))&11884668i777  	*#<<>L	*  	899%6777F	8sW   C	B 	B. AC$$C B+(C*B++C.CCCCCCc                    Vf    V R R# \        V\        4      '       d   \        P                  ! 4       V,           p\        V\
        4      '       d   VP                  4       pWR&   R#   \          d     R# i ; i)a  
Set a custom expiration for the session. ``value`` can be an integer,
a Python ``datetime`` or ``timedelta`` object or ``None``.

If ``value`` is an integer, the session will expire after that many
seconds of inactivity. If set to ``0`` then the session will expire on
browser close.

If ``value`` is a ``datetime`` or ``timedelta`` object, the session
will expire at that specific future time.

If ``value`` is ``None``, the session uses the global session expiry
policy.
Nr   )r   r   r   r   r   r   	isoformatr   s   &&r   
set_expirySessionBase.set_expiryd  sr     =*+ eY''LLNU*EeX&&OO%E"'  s   A) )A87A8c                ^  "   Vf    V P                  R4      G R j  xL
  R # \        V\        4      '       d   \        P
                  ! 4       V,           p\        V\        4      '       d   VP                  4       pV P                  RV4      G R j  xL
  R #  Lz  \         d     R # i ; i L5i)Nr   )	rX   r   r   r   r   r   r   r   r>   r   s   &&r   aset_expirySessionBase.aset_expiry  s     =ii 1222 eY''LLNU*EeX&&OO%Eii)5111 3  	2sD   B-B BB A/B-B+B-B B($B-'B((B-c                V    V P                  R4      ;pf   \        P                  # V^ 8H  # )z
Return ``True`` if the session is set to expire when the browser
closes, and ``False`` if there's an expiry date. Use
``get_expiry_date()`` or ``get_expiry_age()`` to find the actual expiry
date/age, if there is one.
r   )rI   r   SESSION_EXPIRE_AT_BROWSER_CLOSEr$   r   s   & r   get_expire_at_browser_close'SessionBase.get_expire_at_browser_close  s/     hh011F:;;;{r   c                r   "   V P                  R 4      G Rj  xL
 ;pf   \        P                  # V^ 8H  #  L5i)r   N)rN   r   r   r   s   & r   aget_expire_at_browser_close(SessionBase.aget_expire_at_browser_close  s8      II&7888FA;;;{ 9s   757c                T    V P                  4        V P                  4        RV n        R# )zK
Remove the current session data from the database and regenerate the
key.
N)r   deleter   rE   s   &r   flushSessionBase.flush  s    
 	

 r   c                p   "   V P                  4        V P                  4       G R j  xL
  R V n        R #  L5ir)   )r   adeleter   rE   s   &r   aflushSessionBase.aflush  s*     

lln  	s   $646c                    V P                   pV P                  pV P                  4        Wn        V'       d   V P	                  V4       R# R# zE
Create a new session key, while retaining the current session data.
N)r+   r%   creater   r  r$   datar-   s   &  r   	cycle_keySessionBase.cycle_key  s;     }}"KK r   c                   "   V P                  4       G Rj  xL
 pV P                  pV P                  4       G Rj  xL
  Wn        V'       d   V P	                  V4      G Rj  xL
  R# R#  LS L1 L5ir  )r=   r%   acreater   r  r  s   &  r   
acycle_keySessionBase.acycle_key  s_      ''))lln",,s### 	 * $s1   A0A*#A0A,&A0!A."	A0,A0.A0c                    \        R4      h)z6
Return True if the given session_key already exists.
z9subclasses of SessionBase must provide an exists() methodNotImplementedErrorr#   s   &&r   r   SessionBase.exists  s     "G
 	
r   c                T   "   \        V P                  4      ! V4      G R j  xL
 #  L5ir)   )r   r   r#   s   &&r   r   SessionBase.aexists       "4;;/<<<<   (&(c                    \        R4      h)z
Create a new session instance. Guaranteed to create a new object with
a unique key and will have saved the result once (with empty data)
before the method returns.
z8subclasses of SessionBase must provide a create() methodr  rE   s   &r   r  SessionBase.create  s     "F
 	
r   c                R   "   \        V P                  4      ! 4       G R j  xL
 #  L5ir)   )r   r  rE   s   &r   r  SessionBase.acreate  s     "4;;/1111   '%'c                    \        R4      h)z
Save the session data. If 'must_create' is True, create a new session
object (or raise CreateError). Otherwise, only update an existing
object and don't create one (raise UpdateError if needed).
z6subclasses of SessionBase must provide a save() methodr  r$   must_creates   &&r   saveSessionBase.save  s     "D
 	
r   c                T   "   \        V P                  4      ! V4      G R j  xL
 #  L5ir)   )r   r&  r$  s   &&r   asaveSessionBase.asave  s     "499-k::::r  c                    \        R4      h)z`
Delete the session data under this key. If the key is None, use the
current session key value.
z8subclasses of SessionBase must provide a delete() methodr  r#   s   &&r   r  SessionBase.delete  s    
 "F
 	
r   c                T   "   \        V P                  4      ! V4      G R j  xL
 #  L5ir)   )r   r  r#   s   &&r   r  SessionBase.adelete  r  r  c                    \        R4      h)z0
Load the session data and return a dictionary.
z6subclasses of SessionBase must provide a load() methodr  rE   s   &r   r   SessionBase.load  s     "D
 	
r   c                R   "   \        V P                  4      ! 4       G R j  xL
 #  L5ir)   )r   r   rE   s   &r   r   SessionBase.aload  s     "499-////r"  c                    \        R4      h)z
Remove expired sessions from the session store.

If this operation isn't possible on a given backend, it should raise
NotImplementedError. If it isn't necessary, because the backend has
a built-in expiration mechanism, it should be a no-op.
z.This backend does not support clear_expired().r  clss   &r   clear_expiredSessionBase.clear_expired   s     ""RSSr   c                R   "   \        V P                  4      ! 4       G R j  xL
 #  L5ir)   )r   r6  r4  s   &r   aclear_expiredSessionBase.aclear_expired  s     "3#4#457777r"  )__session_keyr   r   r   r    r"   r)   )F)Sr   r   r   r   r   rc   rb   objectrR   r&   r.   r2   r9   r>   rA   propertyrF   rI   rN   rS   rX   r[   r_   rd   rg   rj   rm   rp   rs   rz   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r%   r   r   r=   r+   r   r   r   r   r   r   r   r   r  r  r	  r  r  r   r   r  r  r&  r)  r  r  r   r   classmethodr6  r9  r   __classdictcell__)__classdict__s   @r   r   r   #   s     $ (KE$" H H/>  + -
 '2 <
=GIR(@	
$3$3&5%4##!
!
%"& +,K,.>?L#	# %H+262&8.8"(82	
!!
		$
=
2
;
=
0 T T 8 8r   r   )r   stringr   r   asgiref.syncr   django.confr   django.corer   django.utilsr   django.utils.cryptor	   django.utils.module_loadingr
   ascii_lowercasedigitsr   r   r   r   r   r   r   r   <module>rJ     sZ      ( &    ! 1 5 ((6==8	) 		) 	j8 j8r   