def save_config_value(request, response, key, value):
 request.session[key] = value
 response.set_cookie(key, value, expires=one_year_from_now())
 return response

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