#NEWLINE# def set_response_cookie( response , cookie_name , cookie_value ) : #NEWLINE# #INDENT# 'Common function for setting the cookie in the response.\n\n    Provides a common policy of setting cookies for last used project\n    and region, can be reused in other locations.\n\n    This method will set the cookie to expire in 365 days.\n    ' #NEWLINE# now = timezone . now ( ) #NEWLINE# expire_date = ( now + datetime . timedelta ( days = 365 ) ) #NEWLINE# response . set_cookie ( response , cookie_value , expires = expire_date )