Does blood in the vagina come under the same ruling as menstrual blood even though it has not yet come out?
Question

                Yesterday my period was due, so this morning I inserted a piece of cotton and it came out with the traces of blood on it, so I did not fast, and I continued like that all day. Every time I put in a piece of cotton, I saw blood, but it did not come out until after ‘Isha’. What is the ruling on my breaking the fast when there was blood inside that had not come out? I mean that if I put a piece of cotton inside, it would come out with blood on it, but if I did not do that, no blood came out onto my clothes. Is it regarded as menses, and what is the ruling on my breaking the fast and not praying at that time?
Praise be to Allah.The blood that is inside the vagina [the place where you put the piece of cotton], that has not come out, is regarded as menses. It is not stipulated, for blood to come under the ruling on menses, that it should have come outside the vagina; rather if it remains inside the vagina and stains the piece of cotton that is inserted, it is also menses.
This is the view of the Shaafa‘is and the Hanbalis, and was also narrated from Imam Muhammad ibn al-Hasan al-Shaybaani. 
The aim is to verify the occurrence of the monthly period, which is the shedding of the lining of the uterus as a result of the egg not having been fertilised. The blood that appears on the piece of cotton that is inserted into the vagina is a clear sign of the shedding of the lining of the uterus, which is menses. 
This is indicated by the apparent meaning of the verse in which Allah, may He be glorified and exalted, says (interpretation of the meaning):
“They ask you concerning menstruation. Say: that is a hurt and a pollution, therefore keep away from women during menses and go not unto them till they have purified (from menses and have taken a bath). And when they have purified themselves, then go in unto them as Allah has ordained for you (go in unto them in any manner as long as it is in their vagina). Truly, Allah loves those who turn unto Him in repentance and loves those who purify themselves (by taking a bath and cleaning and washing thoroughly their private parts, bodies, for their prayers, etc.)”
[al-Baqarah 2:222]. 
The words of Allah, may He be glorified and exalted, “Say: that is a hurt and a pollution” Indicate that what matters is the occurrence of harm, even if the blood does not come out to the outside of the vagina. This “harm” appears in the form of cramps and other menstrual symptoms. 
This is also indicated by the report narrated by Maalik in al-Muwatta’ (189) with his isnaad from Umm ‘Ilqimah who said: The women used to send to ‘Aa’ishah vessels containing pieces of cloth on which there was a yellowish discharge from menstrual blood, asking her whether they could pray, and she would tell them: Do not be hasty until you see the white discharge – which signals the end of menses. 
This indicates that the women regarded the yellow discharge that appeared on the cloth as a sign of (ongoing) menses, and ‘Aa’ishah (may Allah be pleased with her) confirmed that. What is meant by the cloth here is the piece of cotton that women used to insert to check on the state of their menses. 
In al-Musannaf (1/90), Ibn Abi Shaybah narrated with his isnaad that ‘Amrah bint ‘Abd ar-Rahman al-Madaniyyah – who was one of the fuqaha’ of the Taabi‘een (d. 98 AH) – used to say to the women: If one of you inserts a piece of cloth and it comes out changed (in colour), she should nor pray until she does not see anything (on the cloth). 
Ibn Hajar al-Haytami (may Allah have mercy on him) said: Blood inside the vagina comes under the same ruling as menses if it is present at the time when it is possible that the woman may be menstruating. The ruling on the presence of menses and the rulings that result from that depend on knowing whether there is any blood present in the vagina that may be menstrual blood; if it is present therein, then it is deemed to be menses, otherwise it is not… Menses comes and goes, so when blood is present in the vagina, we deem it to be menses, even if it does not come out.
End quote from al-Fataawa al-Fiqhiyyah al-Kubra (1/76). 
Al-Bahooti said: What is proven by it coming out is also proven by it being felt in the vagina. So if the woman feels her menses before sunset when she is fasting, then her fast is broken even if the blood does not come out until after sunset.
End quote from Sharh Muntaha al-Iraadaat (1/79) 
Some of the scholars are of the view that it is not menses until the blood appears on the outside of the vagina. This is the view of the Hanafis. 
Al-Kaasaani (may Allah have mercy on him) said:
Emergence of the menstrual blood means that it moves from the inside of the vagina to the outside, because menses, nifaas [post-partum bleeding] and istihaadah [irregular, non-menstrual bleeding] cannot be proven otherwise, according to the apparent meaning of the report.
End quote from Badaa’i‘ as-Sanaa’i‘ (1/39). 
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said:
Some of the scholars think that menses is when the blood is felt – not when there is pain in the abdomen – but does not come out and it remains inside the vagina. They regard it as being exactly the same as what comes out. This is a weak view. 
The correct view is that the woman does not break the fast and her fast is not spoiled except by blood that clearly comes out. So long as it is simply pains, or she feels it, but it has not come out, this does not affect anything.
End quote from Jalasaat Ramadaniyyah, Lesson 16, p. 20 
And he said:
If she feels the menses before sunset, but it does not come out until after sunset, then her fast is complete and is not rendered invalid, according to the correct view, because blood inside the vagina is not subject to any ruling, and because when the Prophet (blessings and peace of Allah be upon him) was asked about a woman who sees in her dream what a man sees – does she have to do ghusl? He said: “Yes, if she sees wetness [a discharge].” 
So the ruling is connected to actually seeing maniy, not to feeling it. The same applies to menses: the rulings thereon do not come into effect unless it is seen coming out, not if it is merely felt. 
End quote from Majmoo‘ Fataawa Ibn ‘Uthaymeen (11/235). 
But the first view is more likely to be correct, because of the strength of the evidence for it. This is what our Shaykh, ‘Abd ar-Rahmaan al-Barraak (may Allah preserve him), thinks more likely to be correct.
Based on that: 
If the piece of cotton is inserted inside the vagina – at the usual time of menses – and comes out with any trace of blood on it, then it is menses, at which time it is forbidden for you to pray or fast. If there was no blood on it, then you must make up the fasts that you broke on those days. 
And Allah knows best.