more flexible handling of cookie_file