added helper JS functions for cookie setting, etc.