on the login page, make sure the login pages form action uses the following code:
action="<?php echo (htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES)); ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != ""?"?".htmlentities($_SERVER["QUERY_STRING"], ENT_QUOTES):""); ?>"
sounds to me like the redirect is going to a different login page than is used for a normal login.
go to the normal login page and make note of the full address in the address bar.
Then try visit the protected page and make note of the address in the address bar, are they the same?
if not, you will need to adjust the redirect location, and probably update the second login page so that it creates the same sessions as the Normal one.