Hello, Hankreddyko -
Your problem seems similar to one I encountered in December 2014 with Firefox.
Eventually, I figured out what causing my problem, and I posted my solution on Fixya.com.
This is my solution from 5 Dec 2014:
I tried the steps of clearing my cookies and cache and even upgraded my Mozilla browser to the latest version, with no luck. Note: I could sign in to my Yahoo! account with Google Chrome and with IE 11. This morning, after "sleeping on it," I wondered if my "Do Not Track" settings (no tracking) on my Mozilla browser was causing the problem of "cookies rejected." First I tried signing into my Yahoo! account with "no tracking" settings through Do Not Track on Mozilla. I couldn't sign in. Then, I disabled the tracking on Do Not Track and tried signing into Yahoo! with Mozilla. Bingo! I could sign in. I have now reset Do Not Track for "no tracking." Others may wish to try this solution if the steps provided through Mozilla support don't work.
Maybe your problem has to do with "Do Not Track".
However, since you also had the same problem with Chrome, another option may be that Yahoo! Mail was down for a while. Whenever I encounter a problem of not connecting to a web site, I go to the website "Is It Down Right Now?" to check. This is the link:
I enter the website name, Example: Yahoo Mail, and click on the Check button. The results come back relatively quickly. If it seems the particular website is "down right now" or "down for just you," you will just have to wait a bit to check again.