The former England international, who left Upton Park in July following a seven-year spell with the club, confirmed the news on the social networking site Twitter.
"I'm in an excellent mood, am happy to be back and can't wait to get working with the lads again and start my season off," the 30-year-old told the club's official website.
"I've been working hard with the strength and conditioning coach Mathew Monte-Colombo in the gym and he's been really hands-on with me to get me up to standard to train with the team and get my match-fitness up as quickly as possible with a view to signing.
"I feel fit and raring to go and it's time to start knocking on the manager's door to get some games under my belt."
Cole, who started his career with Chelsea, has been handed the number 24 shirt.