Well you can use sessions and/or cookies or if your using Apache then you can use HTTP Authorization which I find to be a bit easier to set up and way easier to maintain.
It's all really a matter of what your using and which way you want to go.
There are a couple of really good articles sitting in the columns section on this site, I would highly suggest reading them as they can better describe the basics than I. If you still have questions after that then I'll be happy to assist.
Shaun Hawkes
helpme@phpgods.net
Victoria, B.C.
Canada