I have also experienced this problem. As per my experience when i sit very close to wifi router it connects to wifi and i can surf internet. When i move to other room it lost the connectivity, after that phone shows wifi signals but say "Access denied. cannot connect to network"
Its hardware...