I'm trying to allow my website user to authenticate them selves in order to be able to navigate throw my website. At the moment I've a form-based authentication on JBOSS AS7 and it's working fine. So, now I just wanna fix some problems. Well I set the login page as /login.jsp, and what I noticed is that an authenticated user can navigate again to this page and login again. I want to fix this by detecting whether the user is authenticated or not and if he is, I want to redirect him to another page (cause the login page makes no sense to an authenticated user). How can I do this using JSP? Can I do this directly on the login.jsp or do I need a servlet in the middle?
Also (a question a part) how can I logout the user?
Thanks a lot!