English 中文(简体)
如何检查Django用户是否仍然只从客户方面入住?
原标题:How to check if a Django user is still logged in from the client side only?

www.un.org/Depts/DGACM/index_spanish.htm 在这里,安全不是一个问题。

我需要展示 你在网页上被贴上用户名,但不想从海滩上删除观点,因为这样,我就希望能够用 j语这样做。

我不想对这一进程提出任何批评,只是要检查 co是否仍然有效,如果它表明受欢迎的信息、过敏、显示标志。

整个点是不要打上数据库,使服务器无法使用,因为我们每天只使用这一机器的用户为120000人,因此我需要:

  • the name of the django.contrib.auth cookie so I can read it;
  • the data I m supposed to read from it to decide the user is still logged in
  • a way to extract the username from it

如果我找不到这样做的途径,我就会回头来建立一个有说服力的支持者,在伐木时,再打上标识和删除。

最佳回答

The sessionid cookie is now and has an enddate. 你们可以检查一下,这是否仍然有效,这是否意味着他们被gged住。 你可以这样获得用户名,但你不得不增加一种习俗 co。

问题回答

您的模板中采用了如下表述。

{% block top %}<script async="async" defer="defer" type="text/javascript" src="{% static  users/js/geo.js  %}"

{% if user.is_authenticated %} data-authenticated="true" {% endif %}

></script
>{% endblock %}

检查你是否以类似守则认证:

unsafe_authenticated =  true  === document.currentScript.dataset.authenticated;




相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Remotely authenticating client Windows user on demand

Suppose I am writing a server for a particular network protocol. If I know that the client is running on a Windows machine, is it possible for my server to authenticate the Windows user that owns the ...

Role/Permission based forms authorizing/authentication?

While looking into forms authorizing/authentication, I found that it is possible to do role based authorizing by adding an array of roles to a FormsAuthenticationTicket. That way I can write User....

热门标签