Hi there.
I ususally do this this way:
a global prepend file that start a session.
If a session variable named session_id is not set, redirect to a login page that will check if login/pass is correct and if it is set the session_id variable.
Do not forget that if you dont use ssl people would be able to sniff cookie value that store the session_id and be able to snoop a connection.