better to use html auth instead of http
auth because html auth can be undone.
To my knowledge there is no possible way to "undo" HTTP AUTH. If there were, there would be litterally millions of internet pages that were wide-open to attack.
In http auth the server requests a name and password from the client. No matter what response the client sends, from an empty password to some form of "altered" password, the server checks to see if that name and password combination matches any listed pairs.
There is no way for the client to simply send a "I'm authorized" response that keeps the server from requiring a username and password.
HTTP AUTH is as safe a way to do it as a session or cookie is. Both are made useless by sniffing as are all methods that do not use an encrypted connection.
So to answer the question, the current way you are doing it is fine. The only negative is that some people prefer an html form to the little pop-up window, for purely aesthetic reasons.