The 30-year-old was released by the Hammers at the end of last season before signing a new short-term deal at Upton Park on October 14.
Cole made his second debut for West Ham on Saturday as they drew 0-0 at Swansea City in the Premier League.
"It was really good to be out there again," he told the club's official website. "I was disappointed we didn't win but we were away from home so you can't ask for much more than getting a clean sheet.
"I'm chuffed to get back and to be involved in it again. Any footballer will tell you that have to work hard and the manager has noticed that I was working hard and has given me a new deal. Hopefully I can push on from here and add to the team and play a significant role."
West Ham travel to Championship leaders Burnley on Tuesday in the fourth round of the League Cup.