code: def save_config_value(request, response, key, value):
      
      request.session[key] = value
      response.set_cookie(key, value, expires=one_year_from_now())
      return response
docs: Sets value of key `key` to `value` in both session and cookies.