If you are doing this only for username and password, do them every time. If you are using a standard HTTP authentication type, it does this - it sends the login credentials on every page access. If there is more information you need passed, and this information is to be used repeatedly on multiple accesses to the web page, look at using a per-session cookie instead.
Alternitivley, if it is easier - I have seen some web apps use a session (or longer) cookie for authentication information. In-fact, some Apache modules themselves do this.