Paul Callan is a CNN legal analyst, a former New York homicide prosecutor and current counsel at the New York law firm of Edelman & Edelman PC , focusing on wrongful conviction and civil rights cases. Follow him on Twitter @paulcallan . The opinions expressed in this commentary are his own.

(CNN) Now that Sean Hannity understands that he actually had a "real" attorney-client relationship with Michael Cohen, President Trump's personal lawyer and longtime fixer, the Fox host should next sign up for a lesson in journalistic ethics as a signal that his audience had a right to know all this when they watched his show.

Hannity was clearly blindsided Monday when he was publicly outed -- in Judge Kimba Wood's federal courtroom --as a client of Cohen, who is the subject of a criminal investigation by the US attorney's office in Manhattan.

Despite the Fox host's prior, passionate, on-air defenses of Cohen's actions as the legal defender of Donald Trump, Hannity at first attempted a quick exit, stage right, from any notion that he had a real attorney-client relationship with Cohen, tweeting , "I never retained him, received an invoice or paid legal fees...."

Later, he tweeted again to make it very clear Cohen never represented him in "any matter between me and a third-party."

The subtext here is that no "hush money" was paid to any women on Hannity's behalf, regardless of what Cohen does for the President. Hannity also tempered his earlier, distancing words, tweeting now that he assumed his Cohen conversations were "confidential."

He did this, undoubtedly, because he had been wised-up to the notion that without the existence of an attorney-client relationship with Cohen, none of his communications with the embattled attorney would be shielded from disclosure by the "attorney-client privilege."

Indeed, mass confusion relating to the attorney-client privilege spread like a new strain of flu Monday as Michael Cohen's attorneys sought refuge for his clients under its protective shield. The identities of those clients were bound to impress: the President of the United States, Fox News' Sean Hannity and Republican fundraiser Elliott Broidy.

And this information was revealed as lawyers for the President, Michael Cohen, federal prosecutors and the media argued about who should be allowed access to information or material seized pursuant to a federal search warrant executed on Cohen's office, home and hotel room last week.

One important lesson learned from the proceeding: the names of an attorney's clients are not protected by the attorney-client privilege. What good then is the attorney-client privilege if the fact that you hired an attorney like Michael Cohen who seems to be particularly adept at paying "hush money" to the alleged paramours of prominent married men may appear at any time in tabloids and other media outlets?

Actually, it's good for quite a lot, such as keeping you out of jail, depending on the material lurking in the attorney's files, emails or phone records.

The existence of a legitimate attorney-client privilege with Michael Cohen would prevent law enforcement authorities or others from using any such "privileged" materials in any criminal prosecution, civil lawsuits or even impeachment proceedings.

There are exceptions and limitations to the protective shield of the privilege, such as in situations where the lawyer and the client partner up to commit a crime (the "crime-fraud exception"), or if either the lawyer or the client knowingly discloses the otherwise protected confidences. These exceptions are nuanced and many law journal articles have been written about them.

The need to precisely define when the attorney-client privilege attaches to communications rarely comes up in everyday life. That may, obviously, change during the remainder of the Trump presidency, so a Law School 101 lesson is in order before others get in trouble by foolishly trying to Sean Hannity their way out of the attorney-client relationship.

The attorney-client privilege will attach whenever a person, with a reasonable expectation of confidentiality, consults with a lawyer about a legal matter. That's it. No dollars need be exchanged, nor does a retainer or contract have to be signed for the communication to be protected. At that moment, the attorney-client privilege attaches, even if a more "formal" relationship never ensues.

Follow CNN Opinion Join us on Twitter and Facebook

Communications with the attorney on matters unrelated to legal matters are not shielded by the privilege.