dalecosp;10996316 wrote:
The usual course of action is to use PHP sessions;
"System/test.php?student_id=".$_SESSION['student_id'];
echo "<a href='$link'>Click here</a>";
Which you don't actually do here. There is absolutely no reason to pass a session variable around in any way at all, since it will allready be accesible from each and every page for that session, until the session no longer exists which means that session variable will no longer be available anywhere.
Here, you give the user the option to alter their session id, which also seem to correspond to a student id in some database. Thus, if you were ever to use the user supplied query string parameter student_id, you would have to first check if it's the same as in $_SESSION (otherwise send them back to login page), which obviously means that you might just as well use the session variable to begin with.
Moreover, cookies can also be created and altered client side. Cookies are nothing more than http headers in the end. So if you hand out session ids matching student ids, it's easy to "guess" someone elses id, and keep trying it until someone is logged in.