The iCarly star appeared in a Los Angeles courtroom on Thursday as a judge ordered the fan, Joshua Stockton, to stay at least 100 yards away from Cosgrove, TMZ reports.
The judge told Stockton to not contact the actress for the next three years and to turn over any weapons.
According to TMZ, Stockton appeared in court on Thursday wearing a big, black fur coat and a white bandanna around his head. The publication also claims that he was very disorientated and unable to tell the judge his age without looking at his driver's license for confirmation.
This has been a very unpleasant experience for Cosgrove, who said that Stockton was stalking her and sending her messages threatening suicide because she did not return his love. He also sent her chilling photographs of his slit wrists and the message, "Maybe I'll finish the job I started."
At the time of the scary pictures, Stockton had been upset that Cosgrove sent back, unopened, gifts that he had sent her via UPS.
Cosgrove told the LA court that Stockton is "not living in the real world" and that he is a danger to himself and to her. The judge agreed.
Let's hope that Stockton adheres to the restraining order and that Cosgrove no longer needs to be afraid for her safety.
And you'll see personalized content just for you whenever you click the My Feed .
SheKnows is making some changes!