session_end in jsp

I want to show online users in my web app. when user login i set online=1 and when signs out i set online=0. but what happens when user closes the browser? there's something like session_end event in jsp?
[212 byte] By [xyzta] at [2007-11-27 5:43:04]
# 1
I think there is one javascript event, onunload or something, when triggers when window closes. Use that event in your jsp.
skp71a at 2007-7-12 15:22:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
thanks but i need something server side
xyzta at 2007-7-12 15:22:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
I don't think it's possible at server side. When you close the browser session ends. You need only javascript to determine the cookie expiration. Why don't you invalidate your session, when you close the browser (window onunload event). Thanks.
skp71a at 2007-7-12 15:22:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

> I want to show online users in my web app. when user

> login i set online=1 and when signs out i set

> online=0. but what happens when user closes the

> browser? there's something like session_end event in

> jsp?

Yes there is , lookup HttpSessionListener here : http://java.sun.com/javaee/5/docs/api/

appy77a at 2007-7-12 15:22:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...