
     ht
                     :    d dl mZ d dlmZ  G d de          ZdS )    )SessionBase)signingc                   T    e Zd Zd Zd ZddZddZddZd Zd	 Z	e
d
             ZdS )SessionStorec                     	 t          j        | j        | j        |                                 d          S # t
          $ r |                                  Y nw xY wi S )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    n/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/django/contrib/sessions/backends/signed_cookies.pyloadzSessionStore.load   st    	= ?3355F     	 	 	 KKMMMMM	 	s   36 AAc                     d| _         dS )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    
     Fc                 F    |                                  | _        d| _        dS )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3r   Nc                     dS )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	     ur   c                 0    d| _         i | _        d| _        dS )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                 .    |                                   dS )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                 F    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-    
 }MB	
 
 
 	
r   c                     d S 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      s          (             

 

 

   [  r   r   N)%django.contrib.sessions.backends.baser   django.corer   r   r   r   r   <module>r5      sg    = = = = = =      L L L L L; L L L L Lr   