Login redirects

Once a user has logged in and tries to return to index.php they are
redirected to their profile.php. To be able to view the index.php page
they need to logout which clears all the sessions and cookies