Update index.php

Fixed typo and added code to check login cookies against a database