I was having the same problem. I would loose wifi every time with the screen lock and have to manually rejoin network.
The fix that worked for me was to go to settings, general, reset, reset all settings.
It does not erase any data, media or passwords and I am able to leave ask to join networks off!
I too was having this same problem. The WIFI connection would drop about 30 seconds after the screen locked.
As crazy as this sounds, I tried a variation on Frockstar's method he listed earlier in this thread (page 2?) and it actually worked!
Turn on "ask to join networks."
Wait 30 seconds or so.
Unlock screen - should still be on WIFI. If so, proceed.
Turn off phone.
Turn back on.
Go to settings and turn off "ask to join networks."
Wait 30 seconds or so.
Unlock screen - should still be on WIFI.
Turn off phone.
Turn phone back on.
Not sure what made that work but it did for me.
I went to the Apple store and I could not replicate the issue with their WIFI.
The Geniuses suggested a couple workarounds. One was to make sure my WIFI network name was unique since I left it as default. This would make sure the iPhone was finding the correct network.
The other was to see if there was a firmware update for the WIFI router.
I did both of those things.
After updating the router firmware my WIFI stays connected.
Bottom line - you may need a router update.
My iPhone 5 is doing the same thing. My new 5 will not stay connected to WIFI. Have had no problems with my old 4 even after updating to IOS6. Mine is even picking up a completely different iTunes account even after I input the correct one and connected it to my ITunes account on my Mac. Don't know what happened with Apple but in my opinion this new phone is junk.
Another relatively easy solution to try for those users who are still having problems...
I just received and activated my iPhone 5 yesterday only to find that it would not connect to my time capsule router at home. Two Mac laptops, two iphone 4's, and two iPad 3's (all on iOS 6) had no problems connecting to this router which has WPA2 and Mac Address Filtering enabled and SSID broadcasting disabled.
This morning I went into work and the iPhone could recognize my work's wifi network. I went into the local Apple Store to talk to a Genius and he was able to get the iphone talking to the Apple Store wifi (both secured and open networks). [NOTE: I even tried the iphone 30 feet away from the store in the parking lot and was able to connect.]
The Genius recommended I bring my time capsule in so that they could troubleshoot the wireless connection between both devices. I went home, and, being the problem-solving type, I systematically disabled the security settings on my time capsule (one-by one) and found out that the Mac Address Filtering was preventing me from connecting to my time capsule. I disbled this security setting and my iphone 5 has been stably connecting to the time capsule with no degradation of speed all afternoon.
Bottom line: My router has WPA2 enabled and does not broadcast the SSID. The Mac Address Filtering is DISABLED. [NOTE: For anyone that asks, my iphone has "ask to join networks" disabled.] With these settings my iPhone connects to wifi without issue...
what has worked for me was to delete the wifi access point and then readd it (in my case it was my work wifi which uses WPA2 Enterprise).
Once i deleted the record, and added it back, I no longer experienced unexplained dropped WiFi (both on my iPhone 5/Verizon and my iPhone 4/AT&T).
Those that are experiencing unexplained dropped wifi, try deleting and readding your wifi access point first before looking at other potential causes (eg. your router -- in my case i haven't touched the routers at all).
iPhone will dropped wifi connection while in sleep mode when it's not plugged in to save battery. This is normal. If you want you wifi to be on at all time even while in sleep mode you need to plug it in. What's not normal is when you are using your iphone and wifi can't connect to your wifi network, which is what I'm experiencing. I hope this is just a bug in iOS 6 cause I would hate to have to return my phone back Apple Store.
I got the new Iphone 5 after having my Iphone 3 and 4 work with my wifi without issue.
Everytime I would join it would be fine if the phone was on, once the phone was off, upon turning it on it, was off the network, with LTE there instead.
I came across this thread looking for a solution, what worked for me after trying all the toggling, etc that people mentioned, was the following that someone mentioned
In setting, Wi-Fi, select "other", type in the wifi router name (mine was the one the phone would identify anyway) So I typed it in again, Selected the encryption method, and put in password.
Ask to join network I put on in any case.
And now when I turn my phone on, LTE might be there for a half a second, then it will connect to my wifi.
It seems that manaually selecting and adding your wifi details does the trick, over selecting it from the list that is scans.
I can tell you I was tired of having to type in my long password everything I wanted to connect to my home wifi.
To me it's not a hardware issue, it some type of software issue.
I agree some phones might have wifi technical issues and might be faulty but I think in most cases just select other in your wifi selection, and adding it, will then save your details and always connect, (well, knock on wood, it has for me so far.)
Even after shutting down the phone and starting it, it connects to my wifi right away.