I haven't been back since I last posted my problem on my 4s, because it is now working perfectly.
I am ashamed to admit that all it took was resetting my modem and router.
I called apple support and the first thing they told me was to reset my router. I said that my router didn't need to be reset because all my other devices are connected to it and their internet connection is working smoothly. He then told me to to reset my phone's network connection and bring it back to its factory settings.
I did what he told me to do a couple of times and it still didn't work. With nothing else to do, i finally reset my router and modem by unplugging, waiting for a minute, then plugging it back in all the while thinking that this step is probably useless. While doing that, i reset my phone's network settings for the 3rd time.
When modem and router were plugged in again and internet was back on, my phone's wifi started to work seamlessly! and it has been that way since.
I did everything that I thought would trigger the problem, by connecting to a public wifi, to another resident's wifi, and it is still working perfectly.
I'm sure most people out there have resetted their routers countless times and it still hasn't worked. But this worked for me, and maybe that's all the other users have to do.