Then it is prescribed for the slave to bear witness and declare the testimony of truth upon which the salah is built, as well as one of its rights upon him; that is to say, if he does not testify it, the salah will be of no benefit to him. This is to testify that Allah revealed to His Messenger the Message (i.e. Islam). With this testimony, the salah is finished, as per the statement of Abdullah ibn Masud: “After you say it (i.e. the two testimonies), your salah will have been finished: you have the choice then to either get up or remain sitting down.” (Recorded in Abu Dawud no.970)
However, this word (i.e. finish) can be interpreted linguistically to mean that salah finishes after the testimony has been said, as understood by the people of Kufa, or to mean that the salah is about to finish, as understood by the people of Hijaz. In both cases, the testimony of truth is positioned at the end of the salah similar to how it is prescribed to be the seal of wudu and of life [i.e. it is prescribed to be pronounced at the end of wudu (Recorded in Muslim no.234) and at the end of one’s life]. The Prophet, peace and blessings of Allah be upon him said: “Whoever’s last words before he dies were that there is no Ilah worth of worship except Allah, will enter Paradise.” (Recorded in Abu Dawud no.3116)
After having concluded the salah, and the slave is permitted to ask Allah for anything he wants.
Inner Dimensions of the Prayer by Ibn Qayyim al-Jawziyyah Pages 63-64