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