code: def frontendediting_request_processor(page, request):
      
      if 'frontend_editing' not in request.GET:
          return
  
      response = HttpResponseRedirect(request.path)
  
      if request.user.has_module_perms('page'):
  
          if 'frontend_editing' in request.GET:
  
              try:
                  enable_fe = int(request.GET['frontend_editing']) > 0
              except ValueError:
                  enable_fe = False
  
              if enable_fe:
                  response.set_cookie(str('frontend_editing'), enable_fe)
                  clear_cache()
              else:
                  response.delete_cookie(str('frontend_editing'))
                  clear_cache()
      else:
          response.delete_cookie(str('frontend_editing'))
  
      # Redirect to cleanup URLs
      return response
docs: Sets the frontend editing state in the cookie depending on the
      ``frontend_editing`` GET parameter and the user's permissions.