There is a login system with email and password, however, since I already used $ _SESSION to capture the session id and the user name that is logged in, it would not be a problem to save email and password too, so I would like to do with this login process was automated, just clicking on any link that gave access to the interior of the site. The problem is: How to pass the values of these sessions to a variable?
I'm using this redirect to do page protection:
if(empty($_SESSION['id'])) {
?>
<script type="text/javascript">window.location.href="login.php";
</script>
<?php
exit;
}
So, since it's the only thing I need for system access to be secured, is there any way to put at least the ID embedded in the link that will be generated later?