Automatic WiFi disconnect I am running Android 5.1.1 on my Samsung Galaxy Grand Prime 4g. 

My institute WiFi network that I connect to requires a login everytime to use the internet. However, my phone first connects to the network and then disconnects, wwithout my permission, stating 'Sign-in is required'. I have to connect it again, on which ot leads me to the sign-in windoe, where I plug in my credentials.

If it ultimately has to lead me to the sign-in window, why does it disconnect in the first place? How can I solve this problem?
While the phone is connected to this Wi-Fi that needs log-in, it's keeping the Wi-Fi module busy. The phone can't scan for other Wi-Fi networks. Apps might see that there's a Wi-Fi connection and try to use it, expecting to get the Internet but actually just burning power for nothing. The phone also disconnects from mobile data while a Wi-Fi connection is active (though this is just from the way it's designed).

Disconnecting from the useless Wi-Fi connection keeps the mobile data connection alive, so you still have Internet access. Apps aren't trying to use a connection that's useless to them. And it lets the phone keep scanning for other networks, which you might be able to use without log-in.

I don't understand why you want to "solve this problem": everything works as designed. When you use the "Sign into Wi-Fi network" notification, the phone can immediately reconnect and you can sign in and get a working connection. Automatically disconnecting from captive Wi-Fi portals lets your phone keep working before you're ready to sign in, and it doesn't stop you signing in when you're ready. There's no problem at all.

If you want to sign in automatically, avoiding the disconnect and reconnect entirely, we have a very old question about signing into captive portals, but I'm not sure if the answers are still relevant to newer Android versions.