Since the login count is being tracked in the session, it will automatically be cleared when the browser is closed.
if you wanted to track IP, you could set up a table in the database to track failed attempts.
probably set it up so that when the max number of attempts is reached, it updates the table to store the IP address.
use:
<?php echo((isset($_SERVER["REMOTE_ADDR"]))?$_SERVER["REMOTE_ADDR"]:"") ?>
to get the ip.