The New York Times published a partially-redacted copy of Comey's actual memo from Feb. 14, 2017, describing his conversation with the president about putting journalists in jail:
I then explained why leaks purporting to be about FBI intelligence operations were also terribly and a serious violation of the law. I explained that the FBI gathers intelligence in part of equip the President to make decisions, and if people run around telling the press what we do, that ability will be compromised. I said I was eager to find leakers and would like to nail one to the door as a message. I said something about it being difficult and he replied that we need to go after the reporters, and referred to the fact that 10 or 15 years ago we put them in jail to find out what they know, and it worked. He mentioned Judy Miller by name. I explained that I was a fan of pursuing leaks aggressively but that going after reporters was tricky, for legal reasons and because DOJ tends to approach it conservatively. He replied by telling me to talk to “Sessions” and see what we can do about being more aggressive. I told him I would speak to the Attorney General.
The President then wrapped up our conversation by returning to the issues of finding leakers. I said something about the value of putting a head on a pike as a message. He replied by saying it may involve putting reporters in jail. “They spend a couple days in jail, make a new friend, and they are ready to talk.” I laughed as I walked to the door Reince Priebus had opened.
James Comey memo from February 14, 2017
During an Oval Office meeting on Feb. 14, 2017, President Trump allegedly asked James Comey, then the FBI director, to consider putting journalists in prison for publishing classified information.
Trump began the private meeting by condemning leakers and telling Comey that he should consider putting journalists in prison, according to a memo written by Comey, parts of which were read to The New York Times by an associate of the former FBI director. During the same meeting, Trump allegedly asked Comey to end the FBI investigation, according to the Times.
The Trump administration released a statement disputing the accuracy of information allegedly contained in the memo, saying that it was not a "truthful" or "accurate" representation of the conversation. The statement did not address the statement related to jailing journalists.