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. Cookieless Session Decorator by achimnol 2 years, 9 months ago
  2. easy set cookie expired time by limodou 5 years, 2 months ago
  3. login_required for a generic view in URLconf by pgugged 3 years, 10 months ago
  4. SWFUpload auth decorator by debrice 3 years, 3 months ago
  5. Disallow multiple logins, i.e. from other computer or browser by ayeowch 1 year, 7 months ago

Comments

(Forgotten your password?)