10👍
✅
The sessionid cookie exists and has an expiry date. You could check to see if that is still valid which would suggest they are logged it. You can’t get the username this way though, you’ll have to add a custom cookie.
2👍
Have code like the following in your template.
{% 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 %}
And check if your authenticated with code like:
unsafe_authenticated = 'true' === document.currentScript.dataset.authenticated;
Source:stackexchange.com