"I've always loved West Ham and I hope I can give the club a few memorable seasons," said the 31 year old midfielder.
Cole has struggled to impress at Anfield following a free transfer from Chelsea in 2010 and spent last season on loan at French club Lille.
"It's a great move for me. This is where I learnt my trade and I'm happy to have another chance to be here," added Cole.
"Sam didn't have to sell me the club for me to come back," said Cole.
"For me, I have had 18 months at Liverpool where I haven't played much football and Sam wants to play me.
"I'm going to need games to get back to my best, but I want to play football and come here and help the team to make an impact."
"It was a big thing in me coming back, the fact that everybody here wants me to do well," added Cole, who will again wear the number 26 shirt as he did in his first spell at Upton Park.
"The fans have always been great for me, whenever I have been back and also when I've been in the area visiting family.
"I feel like I owe the club a little bit as well because if it wasn't for West Ham I wouldn't be a footballer. This club's great youth-team coaches taught me the trade.
"Everywhere I go around the world, people love West Ham. People know me for starting here."