The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Advanced session and cookie handlers.

I still can't figure this out. I don't know how boards like phpbb2 knows what messages and forums have new posts since the last time someone logged on. If you update the session every time he logs on then there new icon would never appear because the updated time will be greater than the last post for a forum or a thread. How are there session handles written?

How can I record the time whenever a users leaves my page for another page or closes the browser?

My solution for this would be to have a 'last login' field in the database and check posts as 'new' that have a newer timestamp than the 'last login' field. This code isn't for this, but it gives the same idea.

I use this to track 'active visitors' on my site, it updates their timestamp everytime they visit a page that runs the logip() function and changes all timestamps to 0 that are older than 2 minutes. I hope this helps give an idea. I will make a script a little later describing it better.