Set test cookie unless logged in

1
2
3
4
class SetTestCookieMiddleware(object):
	def process_request(self, request):
		if not request.user.is_authenticated():
			request.session.set_test_cookie()

More like this

  1. Login message middleware by nipuL 5 years, 2 months ago
  2. OracleAuthBackend by nosrednakram 3 years, 10 months ago
  3. HTTPS redirections middleware with updated URL template tag by xlq 8 months ago
  4. Auth decorators with 403 by Magus 6 years ago
  5. Cookieless Session Middleware by juliocarlos 4 years, 6 months ago

Comments

(Forgotten your password?)