|
Server : Apache System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64 User : njnconst ( 1116) PHP Version : 8.4.18 Disable Function : NONE Directory : /usr/lib64/python2.7/site-packages/django/contrib/sessions/backends/ |
Upload File : |
�
r�\c @ sJ d d l m Z d d l m Z d d l m Z d e f d � � YZ d S( i����( t settings( t signing( t SessionBaset SessionStorec B s_ e Z d � Z d � Z e d � Z d d � Z d d � Z d � Z d � Z
e d � � Z RS( c C sW y, t j | j d | j d t j d d �SWn$ t j t f k
rR | j � n Xi S( s�
We load the data from the key itself instead of fetching from
some external data store. Opposite of _get_session_key(),
raises BadSignature if signature fails.
t
serializert max_aget salts/ django.contrib.sessions.backends.signed_cookies( R t loadst session_keyR R t SESSION_COOKIE_AGEt BadSignaturet
ValueErrort create( t self( ( sQ /tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/signed_cookies.pyt load s c C s
t | _ d S( s�
To create a new key, we simply make sure that the modified flag is set
so that the cookie is set on the client for the current request.
N( t Truet modified( R
( ( sQ /tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/signed_cookies.pyR s c C s | j � | _ t | _ d S( s�
To save, we 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.
N( t _get_session_keyt _session_keyR R ( R
t must_create( ( sQ /tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/signed_cookies.pyt save s c C s t S( s�
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.
( t False( R
R ( ( sQ /tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/signed_cookies.pyt exists) s c C s d | _ i | _ t | _ d S( s�
To delete, we 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.
t N( R t _session_cacheR R ( R
R ( ( sQ /tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/signed_cookies.pyt delete1 s c C s | j � d S( s�
Keeps the same data but with a new key. To do this, we just have to
call ``save()`` and it will automatically save a cookie with a new key
at the end of the request.
N( R ( R
( ( sQ /tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/signed_cookies.pyt cycle_key; s c C s4 t | d i � } t j | d t d d d | j �S( s�
Most session backends don't need to override this method, but we do,
because instead of generating a random string, we want to actually
generate a secure url-safe Base64-encoded string of data as our
session key.
R t compressR s/ django.contrib.sessions.backends.signed_cookiesR ( t getattrR t dumpsR R ( R
t
session_cache( ( sQ /tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/signed_cookies.pyR C s c C s d S( N( ( t cls( ( sQ /tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/signed_cookies.pyt
clear_expiredO s N(
t __name__t
__module__R R R R t NoneR R R R t classmethodR ( ( ( sQ /tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/signed_cookies.pyR s
N( t django.confR t django.coreR t% django.contrib.sessions.backends.baseR R ( ( ( sQ /tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/signed_cookies.pyt <module> s