Abu Abd al-Rahman al-Sulami (may Allah have mercy on him) said: I prayed with Sayyiduna Ali and Sayyiduna Abdullah (bin Mas'ud) (may Allah be pleased with them both), and I saw that they both gave the salam to their right and to their left: As-salamu alaykum wa rahmatullah, as-salamu alaykum wa rahmatullah. And the narrator stated that they both used to pray behind the Messenger of Allah (peace and blessings be upon him), and he (peace and blessings be upon him) would give the salam to his right: "As-salamu alaykum wa rahmatullah (Peace be upon you and the mercy of Allah)", and to his left: "As-salamu alaykum wa rahmatullah (Peace be upon you and the mercy of Allah)", until the whiteness of his cheek could be seen from both sides.
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 10155