My iPhone 5 waits for ages to connect to Wi-Fi

When I try to connect to a public wifi connection (BT, Cloud, O2 etc) my iPhone 5 waits for ages to connect until I press 'Cancel' and then 'Use without internet' and then it almost connects immediately.

It very rarely just connects without any issues.

I'm using the latest ios.

Any ideas?
Have you tried resetting the network settings?
I have done it previously but not recently, will give it a go.
Yeah try that and also a hard reset.
OK, thanks for the suggestions.
Try a complete wipe. If that won't help then you better get it checked at Apple.

Original thread: https://forums.imore.com/threads/my-iphone-5-waits-for-ages-to-connect-to-wi-fi.279237/