title: Safe way to know if user is logged in client side with Django
body: <p>My website project shows user specific data in almost every page (e.g. show username in topbar if logged which is existent in all pages), show liked items, etc...</p>
  
  <p>I use AJAX to get html fragments depending if the user is authenticated or not (e.g. show username in topbar if authenticated, otherwise signup/login buttons).</p>
  
  <p>My question is, the above method causes me to invoke AJAX GET request in almost all pages and subsequently at least doubles the HTTP requests &amp; the server load, is it safe to add some cookie <code>logged_in: true</code> and check it so I invoke the AJAX GET request ONLY IF the user is logged in.</p>
  
  <p>The convention in Django and modern webdev is to add only the session id in the cookies and everything is in the server side, is there a safe way to know if the user is logged in client side?</p>