I will keep it simple, I have a simple website with two JSP pages, Main.jsp and Form.jsp, and a servlet for each.
In Main.jsp the user will enter a username and password, to which I will compare them to an SQL stored data, if data match I redirect the user to Form.jsp, if not then reload Main.jsp.
That's great and all, until I realized that anyone can type the URL of Form.jsp and have access to the page and skipping the first authentication page.
I am new to web development, what is the solution for this ?, is there some sort of session manager ?.
Not only do I want to control access to From.jsp, but I also want to know which user filled the form, instead of just any random user with a url to the form can fill it (Since Form.jsp directly updates an SQL table, I want to store the username of whoever updated the table alongside the data).