I know you can set the session variable time(default is 20 minutes) but I want to know how long my user is connect.
so if they come onto a page and leave after 5 minutes I want to write this to my database.

any suggestions?

thanks