Yes, add it on the login page. Saved session variables are automatically available on any pages after they are set. Just make sure the session is started on the page when you want to reference them like:
Please use separate posts for new questions. What causes the old code issue? Where does it appear? Most likely that can just be deleted, but I'd need more information about the context and page content to be sure.