change the script to detect runtime hostname and cookie value