It is given: web application on pure java (without frameworks). It is necessary to redirect unregistered users to the login page. What is the best way to do this? There are ideas to implement using filter or js (sessionStorage) or cookies.

Closed due to the fact that the essence of the question is incomprehensible by the participants Roman C , freim , 0xdb , aleksandr barakin , Suvitruf 29 Apr at 8:16 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

    1 answer 1

    Yes, the easiest thing is to get a filter that will check for the presence of a sign of "authorization" of the user in the request. Such a sign can be, for example, a cookie with some kind of token, by which you can definitely "identify" the user. Or anything that will help you uniquely identify the user.