The former Hull KR and Wakefield Trinity winger joined the club ahead of this season and - having switched to half-back - has been key in their rise to the top of the League 1 table.
Cockayne, who played more than 200 games for the Robins, has enjoyed a new lease of life at promotion-chasing York and decided to play on again in 2019 with James Ford’s exciting side.
“I’m very proud and privileged to be staying on at York,” he said.
“The whole experience has been superb - the facilities, the training, the playing/coaching staff are all outstanding people and I can’t wait to continue the journey.
“We’ve by no means finished this year and it’s a tough run in to finish the season but me and the boys will be doing our utmost to finish in first position.
“I have to say a big thanks to Fordy and JF [Owner, Jon Flatman] for giving me the opportunity to go around again with York.
“Once conversions opened up I had no intentions of testing the market and looking around because I’m very happy and I think that’s helping me make a positive contribution to the team.
“The new stadium excites me, prospects of where York can go as a club excites me and to be able to play a small part in all of that excites me and gives me a real sense of purpose.
“I’m as hungry as ever to keep playing and keep working hard for the whole organisation.”
Ford, whose side host Oldham on Sunday, added: “I’m delighted that Ben has signed a new deal.
“His tenacity and experience has been vital both on and off the field this season, and he deserves credit for looking after himself and keeping in great shape.
“Ben has been key in the development of some of our outstanding young players and I’m pleased that he will be around next year to continue his important role in the squad.
“I’d also like to thank the YCK supporters who have backed the club immensely by purchasing their season tickets in brilliant numbers, allowing us to budget for the squad accordingly.”