On the login page, you wouldn't want that check in the posted code because what it's doing is checking if a user is logged in. So, on the "login" page, we assume that a user is not logged in and we wouldn't want to check that he is logged in with our check.
With that said, on your login page, don't use the code snippet I gave you, but it's still okay to do session_start();
So the code I gave you is to be used elsewhere in your site where you want to check if a user is logged in.
On the login page, though, you wouldn't want to use that code. Instead the following would be okay:
<?php
session_start();
// rest of your page for the login form
?>