Cohen has admitted that he paid Daniels $130,000 days before the 2016 election.
Cohen also arranged a $1.6-million payment to secure the silence of a former Playboy model who said she became pregnant by Elliott Broidy, a top Republican fundraiser, a person familiar with the matter said Friday.
Hannity is a conservative television host known for passionately advocating for Trump on his Fox News show, and often receiving public praise from Trump in return. The investigation has frustrated the White House as it has spread to enfold some of Trump's closest confidantes.
U.S. District Judge Kimba Wood said in hearings Friday and again on Monday that if Cohen wanted the court to declare that the some of his files were protected because of attorney confidentiality rules, he would have to divulge the names of his clients.
The unexpected naming of Hannity made him the latest outsized media personality to be drawn into the investigation's cast of unlikely supporting characters.
The porn star, real name Stephanie Clifford, is fighting to quash the agreement.
It began with an appearance by porn actress Stormy Daniels, who was swarmed by photographers and almost fell as she was hustled into the courthouse, a scene that captured the sensational atmosphere around a legal fight involving the president and an FBI investigation into his personal attorney.
Daniels's lawyer, Michael Avenatti, said that she would be in federal court Monday to watch Cohen's hearing.
Cohen, dressed in a dark suit, at times looked tense, folding and clasping his hands in front of him.
Cohen has argued that some of the documents and data seized in last week's raids are protected by attorney-client privilege or otherwise unconnected to the investigation. The attorneys argued that the third client's name should remain anonymous.
Wood ordered Cohen's lawyers to be ready with a list of Cohen's clients on Monday to support their argument.
The Justice Department says Cohen is being investigated for criminal conduct "that largely centres on his personal business dealings". He never mentioned his association with Cohen during the broadcast. "I have many (too many!) lawyers and they are probably wondering when their offices, and even homes, are going to be raided with everything, including their phones and computers, taken".
But prosecutors want the documents to be reviewed for attorney-client privilege by a "taint team" of lawyers within their own office, who would be walled off from the main prosecution team.
"I understand he doesn't want his name out there, but that's not enough under the law", she said.
Hannity and Cohen did not immediately respond to requests for comment from Business Insider.
"My attorney and I are committed to making sure that everyone finds out the truth and the facts of what happened", she added.