
    g                     2    d dl mZ d dlmZ  G d de      Zy)    )SessionBase)signingc                       e Zd Zd Zd Zd Zd ZddZddZddZ	dd	Z
dd
ZddZd Zd Zd Ze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    /var/www/python.vincentserveurtest.ovh/public_html/venv/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                 *   K   | j                         S wN)r   r   s    r   aloadzSessionStore.aload   s     yy{   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                 *   K   | j                         S wr   )r   r   s    r   acreatezSessionStore.acreate$   s     {{}r   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   c                 .   K   | j                  |      S w)N)r"   r#   r!   s     r   asavezSessionStore.asave0   s     yy[y11   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.exists3   s     r   c                 .   K   | j                  |      S wN)r   )r+   r*   s     r   aexistszSessionStore.aexists;        {{{{33r'   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.delete>   s      r   c                 .   K   | j                  |      S wr-   )r3   r*   s     r   adeletezSessionStore.adeleteH   r/   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.
        Nr%   r   s    r   	cycle_keyzSessionStore.cycle_keyK   s    
 			r   c                 *   K   | j                         S wr   )r7   r   s    r   
acycle_keyzSessionStore.acycle_keyR   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_keyU   s)    
 }}MMB	
 	
r   c                      y r   r)   clss    r   clear_expiredzSessionStore.clear_expireda   s    r   c                    K   y wr   r)   r?   s    r   aclear_expiredzSessionStore.aclear_expirede   s	     s   )Fr   )__name__
__module____qualname__r   r   r   r   r#   r&   r+   r.   r3   r5   r7   r9   r   classmethodrA   rC   r)   r   r   r   r      sk    (244 

    r   r   N)%django.contrib.sessions.backends.baser   django.corer   r   r)   r   r   <module>rJ      s    = b; br   