If you are using Linux or Unix, htaccess is the safest way.
But you can also use cookies like this:
On the page where you check the password, set a cookie, something like this:
Response.Cookies("NameOfCookie") = "Validated";
Then on the page they are accessing, use this:
if...