title: How to find all logged-in users and those users who are accessing the site but havn't logged-in?
body: <p>I am developing a project purely on JSP and Servlets and require:</p>
  
  <ol>
  <li>to show a list of logged-in users </li>
  <li>and show the number of users accessing the site without login.</li>
  </ol>
  
  <p>Does the Servlet API provide some solution to this?</p>
  
  <p>I found this <a href="https://stackoverflow.com/questions/9804331/how-to-list-out-all-the-logged-on-users-in-a-web-application-using-jsp-servlets">answer</a>, this might answer my first question but is not detailed enough.</p>
  
  <p>Also in addition to the above two questions, I would also like to know if I can log IP addresses of the Users accessing my site?</p>
  
  <p>I am still studying the various concepts of Java EE and doesn't know how to start on this, so keeping this in mind please provide a starting point and a little detail as to how these three things can be achieved. Also I would be grateful if you can provide links or explanation which will help me understand the underlying concepts.</p>