upload and cookie improvements