javi_d 0 Newbie Poster

I have a lab to do a simple chat program that has to
1. identify users
2. list online users (means to determine who's logged out and who has closed the page but hasn't logged out)

i'm identifying users by session.
I'm having problem with determining a user who hasn't logged but has closed the page.
It says that i have to use a session listener or smth.

Frankly, i'm studying jsp for 3-4 weeks now and completely don't know how to do this.
Help please!