https://t.me/AnonymousX5
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.7/site-packages/django/contrib/sessions/backends/base.pyc
�
r�\c@s ddlmZddlZddlmZmZddlZddlZddlmZddl	m
Z
ddlmZddlm
Z
ddlmZdd	lmZdd
lmZmZddlmZddlmZejejZd
efd��YZdefd��YZdS(i����(tunicode_literalsN(tdatetimet	timedelta(tsettings(tSuspiciousOperation(tconstant_time_compare(tget_random_string(tsalted_hmac(ttimezone(tforce_bytest
force_text(timport_by_path(tSuspiciousSessiontCreateErrorcBseZdZRS(u�
    Used internally as a consistent exception type to catch from save (see the
    docstring for SessionBase.save() for details).
    (t__name__t
__module__t__doc__(((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyR
stSessionBasecBs�eZdZdZdZd*d�Zd�Zd�Zd�Z	d�Z
d*d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Ze e�Z!e"d�Z#e e#�Z$d�Z%d�Z&d �Z'd!�Z(d"�Z)d#�Z*d$�Z+d%�Z,e"d&�Z-d*d'�Z.d(�Z/e0d)��Z1RS(+u-
    Base class for all Session classes.
    u
testcookieuworkedcCs1||_t|_t|_ttj�|_dS(N(t_session_keytFalsetaccessedtmodifiedRRtSESSION_SERIALIZERt
serializer(tselftsession_key((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyt__init__%s			cCs
||jkS(N(t_session(Rtkey((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyt__contains__+scCs|j|S(N(R(RR((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyt__getitem__.scCs||j|<t|_dS(N(RtTrueR(RRtvalue((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyt__setitem__1s
cCs|j|=t|_dS(N(RRR(RR((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyt__delitem__5s
cCs|jj||�S(N(Rtget(RRtdefault((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyR#9scGs.|jp||jk|_|jj||�S(N(RRtpop(RRtargs((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyR%<scCs8||jkr|j|St|_||j|<|SdS(N(RRR(RRR ((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyt
setdefault@s
	
cCs|j||j<dS(N(tTEST_COOKIE_VALUEtTEST_COOKIE_NAME(R((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pytset_test_cookieHscCs|j|j�|jkS(N(R#R)R((R((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyttest_cookie_workedKscCs||j=dS(N(R)(R((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pytdelete_test_cookieNscCs#d|jj}t||�j�S(Nudjango.contrib.sessions(t	__class__RRt	hexdigest(RR tkey_salt((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyt_hashQscCsH|j�j|�}|j|�}tj|j�d|�jd�S(uHReturns the given session dictionary serialized and encoded as a string.t:uascii(RtdumpsR0tbase64t	b64encodetencodetdecode(Rtsession_dictt
serializedthash((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyR5UscCs�tjt|��}yb|jdd�\}}|j|�}t|j�|�sctd��n|j�j	|�SWnRt
k
r�}t|t�r�t
jd|jj�}|jt|��niSXdS(NR1iuSession data corruptedudjango.security.%s(R3t	b64decodeR	tsplitR0RR6RRtloadst	Exceptiont
isinstanceRtloggingt	getLoggerR-RtwarningR
(Rtsession_datatencoded_dataR9R8t
expected_hashtetlogger((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyR6[s	cCs|jj|�t|_dS(N(RtupdateRR(Rtdict_((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyRGnscCs
||jkS(N(R(RR((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pythas_keyrscCs
|jj�S(N(Rtkeys(R((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyRJuscCs
|jj�S(N(Rtvalues(R((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyRKxscCs
|jj�S(N(Rtitems(R((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyRL{scCs
|jj�S(N(Rtiterkeys(R((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyRM~scCs
|jj�S(N(Rt
itervalues(R((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyRN�scCs
|jj�S(N(Rt	iteritems(R((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyRO�scCsi|_t|_t|_dS(N(t_session_cacheRRR(R((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pytclear�s		cCs3x,tr.tdt�}|j|�sPqqW|S(u*Returns session key that isn't being used.i (RRtVALID_KEY_CHARStexists(RR((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyt_get_new_session_key�s
	cCs(|jdkr!|j�|_n|jS(N(RtNoneRT(R((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyt_get_or_create_session_key�scCs|jS(N(R(R((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyt_get_session_key�scCs_t|_y|jSWnAtk
rW|jdks9|rEi|_qX|j�|_nX|jS(u�
        Lazily loads session from storage (unless "no_load" is True, when only
        an empty dict is stored) and stores it in the current instance.
        N(RRRPtAttributeErrorRRUtload(Rtno_load((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyt_get_session�s	
cKs�y|d}Wntk
r-tj�}nXy|d}Wn tk
r^|jd�}nX|sltjSt|t�s|S||}|jd|j	S(u�Get 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.
        umodificationuexpiryu_session_expiryi�Q(
tKeyErrorRtnowR#RtSESSION_COOKIE_AGER>Rtdaystseconds(Rtkwargstmodificationtexpirytdelta((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pytget_expiry_age�s


cKs�y|d}Wntk
r-tj�}nXy|d}Wn tk
r^|jd�}nXt|t�rr|S|s�tj}n|td|�S(u�Get 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.
        umodificationuexpiryu_session_expiryR`(	R\RR]R#R>RRR^R(RRaRbRc((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pytget_expiry_date�s

cCs_|dkr/y|d=Wntk
r*nXdSt|t�rQtj�|}n||d<dS(u+
        Sets 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.
        u_session_expiryN(RUR\R>RRR](RR ((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyt
set_expiry�s
cCs/|jd�dkrtjS|jd�dkS(u
        Returns ``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.
        u_session_expiryiN(R#RURtSESSION_EXPIRE_AT_BROWSER_CLOSE(R((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pytget_expire_at_browser_close�scCs"|j�|j�|j�dS(ue
        Removes the current session data from the database and regenerates the
        key.
        N(RQtdeletetcreate(R((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pytflushs

cCs6|j}|j}|j�||_|j|�dS(uW
        Creates a new session key, whilst retaining the current session data.
        N(RPRRkRj(RtdataR((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyt	cycle_keys
		
	cCs
t�dS(uG
        Returns True if the given session_key already exists.
        N(tNotImplementedError(RR((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyRSscCs
t�dS(u�
        Creates 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.
        N(Ro(R((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyRk!scCs
t�dS(u�
        Saves the session data. If 'must_create' is True, a new session object
        is created (otherwise a CreateError exception is raised). Otherwise,
        save() can update an existing object with the same key.
        N(Ro(Rtmust_create((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pytsave)scCs
t�dS(u}
        Deletes the session data under this key. If the key is None, the
        current session key value is used.
        N(Ro(RR((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyRj1scCs
t�dS(uB
        Loads the session data and returns a dictionary.
        N(Ro(R((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyRY8scCs
t�dS(u
        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.
        N(Ro(tcls((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyt
clear_expired>s	N(2RRRR)R(RURRRR!R"R#R%R'R*R+R,R0R5R6RGRIRJRKRLRMRNRORQRTRVRWtpropertyRRR[RReRfRgRiRlRnRSRkRqRjRYtclassmethodRs(((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyRsX																																		(t
__future__RR3RRR?tstringtdjango.confRtdjango.core.exceptionsRtdjango.utils.cryptoRRRtdjango.utilsRtdjango.utils.encodingR	R
tdjango.utils.module_loadingRt"django.contrib.sessions.exceptionsRtascii_lowercasetdigitsRRR=R
tobjectR(((sG/tmp/pip-install-XxeQeY/django/django/contrib/sessions/backends/base.pyt<module>s 

https://t.me/AnonymousX5 - 2025