
    Hwgt
                     2    d dl mZ d dlmZ  G d de      Zy)    )SessionBase)signingc                   L    e Zd Zd Zd Zd
dZddZddZd Zd Z	e
d	        Zy)SessionStorec                     	 t        j                  | j                  | j                  | j	                         d      S # t
        $ r | j                          Y i S w xY w)z
        Load the data from the key itself instead of fetching from some
        external data store. Opposite of _get_session_key(), raise BadSignature
        if signature fails.
        /django.contrib.sessions.backends.signed_cookies)
serializermax_agesalt)r   loadssession_keyr	   get_session_cookie_age	Exceptioncreateselfs    f/var/www/horilla/myenv/lib/python3.12/site-packages/django/contrib/sessions/backends/signed_cookies.pyloadzSessionStore.load   sX    	==  ??335F   	 KKM			s   := AAc                     d| _         y)z
        To create a new key, set the modified flag so that the cookie is set
        on the client for the current request.
        TN)modifiedr   s    r   r   zSessionStore.create   s    
     c                 <    | j                         | _        d| _        y)z
        To save, get the session key as a securely signed string and then set
        the modified flag so that the cookie is set on the client for the
        current request.
        TN)_get_session_key_session_keyr   )r   must_creates     r   savezSessionStore.save!   s     !113r   Nc                      y)z
        This method makes sense when you're talking to a shared resource, but
        it doesn't matter when you're storing the information in the client's
        cookie.
        F r   r   s     r   existszSessionStore.exists*   s     r   c                 .    d| _         i | _        d| _        y)z
        To delete, clear the session key and the underlying data structure
        and set the modified flag so that the cookie is set on the client for
        the current request.
         TN)r   _session_cacher   r   s     r   deletezSessionStore.delete2   s      r   c                 $    | j                          y)z
        Keep the same data but with a new key. Call save() and it will
        automatically save a cookie with a new key at the end of the request.
        N)r   r   s    r   	cycle_keyzSessionStore.cycle_key<   s    
 			r   c                 \    t        j                  | j                  dd| j                        S )z
        Instead of generating a random string, generate a secure url-safe
        base64-encoded string of data as our session key.
        Tr   )compressr   r	   )r   dumps_sessionr	   r   s    r   r   zSessionStore._get_session_keyC   s)    
 }}MMB	
 	
r   c                      y Nr   )clss    r   clear_expiredzSessionStore.clear_expiredO   s    r   )Fr,   )__name__
__module____qualname__r   r   r   r    r$   r&   r   classmethodr.   r   r   r   r   r      s9    (

  r   r   N)%django.contrib.sessions.backends.baser   django.corer   r   r   r   r   <module>r5      s    = L; Lr   