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