Ex-Manchester United stopper Foster retired last summer following relegation with Watford.
But the 40-year-old returned to the game earlier this year with Wrexham.
Foster’s arrival helped the Welsh side to clinch promotion to the Football League as they lifted the National League title.
Now another old England squad member will be hoping for similar success with York City.
The 37-year-old David Stockdale, who was involved in a Twitter trolling match with Paddy Kenny, was released by Sheffield Wednesday last week after helping them return to the Championship.
After an incredible record-breaking comeback against Peterborough, they then beat Barnsley in the League One play-off final at Wembley.
Now the Leeds-born stopper, who made his pro debut for the Minsterman back in 2003, is back at York.
Since his early days with the club, he has gone on to enjoy five promotion winning campaigns and played for the likes of Fulham and Brighton in the Premier League.
He was also called up to the England squad during Roy Hodgson’s tenure in charge and now he cannot wait to get back out on the pitch at York.
BETTING SPECIAL – BEST NO DEPOSIT CASINO OFFERS
Stockdale said: “It was one of the things I wanted to do, to come back here.
“I didn’t express that to anybody but my family, but 20 years after I made my debut, to come back and try and help while I can, I’m really pleased.
“What a place this is to have York City and York RLFC.
“I remember them talking about it years back when I was carrying buckets around Bootham Crescent trying to save the club.
“Those feelings lay deep when you’re stood outside a club trying to save its existence.”
TRANSFER NEWS LIVE: All the latest news, rumours and confirmed switches from the world of football