Example code: redirect to login.php on unauthorized