A New Jersey judge has ordered a teenager who accused a man of rape to turn over access to her Facebook page.

Mercer County superior court judge Robert Billmeier this week agreed to a request from David Stevens-Parker’s defence attorney, and the judge said he will privately review two weeks of Facebook postings for any comments related to the alleged rape before deciding whether any can be used in court.

The defence attorney, Andrew Ferencevych, said he wants to see if there are any hints that the sex was consensual. Stevens-Parker, 22, was charged with providing the then-16-year-old Princeton girl with alcohol before sexually assaulting her in April 2013.

Assistant Prosecutor John Carbonara said Ferencevych cited a state court ruling that allowed a defence attorney to require a victim to submit to an eye exam, but Carbonara argued that ordering the teenager to turn over Facebook access was a greater invasion of privacy. He said courts do not typically order crime victims to turn over information.

If you asked a typical teenager whether having an eye examination or giving over Facebook passwords was more of an invasion, “I guarantee 100% of them would say to look at your Facebook,” Carbonara said. “That’s the predominant way they communicate to their friends on a lot of issues.”

Content from social media is routinely used in court, but the New Jersey case is different because it involves a judge ordering an alleged victim to turn over information, said Wendy Patrick, a prosecutor and former chairwoman of the California state bar ethics committee.

“It’s used all the time and the reason is because the internet has become a confessional,” Patrick said. “It’s a place where everyone is an open book.”

Patrick noted that authenticating content found on social media is often the most difficult part of trying to use it as evidence.

Among the other recent cases where posts on Facebook and other social media have been used in court:

— The case of two Ohio high school football players convicted of raping a 16-year-old West Virginia girl drew international attention because of the role of texting and social media in exposing the attack.

— Also in Ohio, a grand jury decided not to charge anyone in connection with a public sex act that was photographed by witnesses and later reported by the woman as a sexual assault after images circulated on social media.

— A defence attorney for a man convicted of killing a University of New Hampshire student spent several hours going over Facebook pages and conversations in an attempt to convince jurors that the state’s star witness was possessed by imaginary characters.

Carbonara said that the teen victim in the New Jersey case told him she was willing to turn over the information to the judge. Patrick said that it is good to know that she is not opposed to the judge reviewing her Facebook page.

“Think how you would feel if someone went into your room and said, ‘I must read your diary to see if anything is relevant?’” Patrick said. “It’s just invasive.”