Help for logout and cookie
... I'm new to the forum and I hope to put this thread in the right section!
I have to make a simple web application that is able to handle the log-in
and log-off of a user, displaying a form of log-in if the user
not 'authenticated, the home page and if'.
Constraints of creation:
- Use other technologies ("Session" HTTP Java, for
example) for maintaining session information.
I created the application with eclipse / tomcat in Java
I made an index.html page, where I enter the login form
I created a servlet for login I check if user and pass are correct (with reference to a static database), displaying a homepage where the user is in database, if no error is present.
In this servlet HttpSession session and I used a counter to see how many times a user views the section ... so far so good ...
but how do I log out
I tried to put this code in homepage.html:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<h1> Benvenuto </h1><br><br>
<li>Scrivi un commento</li>
<li>Cerca un articolo</li>
<form action="ServletLogout" method="post">
and to build a servlet using session.invalidate logout ()
... .. but still keep the session open even if I log out ... HOW DO I ?!?!!?
And where / how to put COOKIE?!?!
I HOPE IN YOUR HELP ... THANKS