There are
many possible solutions to this, and you can use any of them. It is your application and you have to define the actual logic that would be working on the back-end of your application to make this process
look like working. I would try to give you a few of these examples, you can see for which one would suit you.
If you're using a form, and upon submit you redirect the user to the next page to fill the next form. Then using an input field would be a good one for you, you can embed the UserID of the user (student in your case) inside the form, as a
hidden field. Which won't be visible to the user, but you will be able to use its value on the server-side to perform student-specific actions. Have a look at the following form,
<input type="hidden" name="studentID" value="@ValueFromServer" />
The
ValueFromServer would be populated by server and would contain the UserID. On the server, you can access this value as this code,
var userId = Request["studentID"];
Furthermore, you can first allow the users to register on your website, and then use their logged_in state and their ID to perform these actions (which would be still same as above, but just that the scope of the value would increase). This way you can get the UserID of the student on every page inside your application.
You can also save the values in the cookies,
localStorage[
^] or many more methods. It depends on how you try to be using it.
Never store any sensitive information on the client-side cookies; such as passwords, credit card information etc.