With PHPSecureArea, when you set up a secure area protected by a htaccess / htpasswd file you may find that you have to login twice.
The probable reason is that you have linked to the protected area as
http://www.domainname.com/protected
or
http://www.domainname.com/protected/
Change this to the full file url for example :
http://www.domainname.com/protected/index.html