Like Mdiaz states you can use Session or Cookie variables, but you do not want to rely upon those totally, becuase they are static text files being transferred on the internet. But, rather use those in conjunction with other options for passing the data, like Form Variables and Query String variables. Also, I find the best way to use a script like the one above, is to make it it’s own .asp and simply use a SSI to include it on every page, like:
<!-- #INCLUDE FILE="secure.asp" -->
However, I would read up on enabling HTTP Authentication capabilities of IIS 5.0 if you are running that, but if not at least study up on Hybrid Authorization scripts in base64 encryption/ decryption, which is not the best, but better than a simple session or cookie variable. Most books have scripts pre-written for this (Wrox Press, Sam’s Teach Yourself, and of course O’Reilly).
One other thing to be wary of is placing a heavy load on your server. If your site is going to be getting more than your predicted user level, make sure the server is not checking X amount of people for x amount of pages every view.