i had this problem once, but since i've done the following my connection hasn't been lost, for no real reason since... it's low tech. when you do
Code:
iwconfig wlan0 key 1232312312kh231234
you may notice that sometimes your essid is actually typed in, and if you are like me, i say "great!" however, you still need to set your essid by doing the old
Code:
iwconfig wlan0 essid nameofessid
where nameofessid is obviously your name of essid.
if i'm wrong i'm wrong, but i haven't had that issue since. later.