Timeout session

Hello, this question has been here before and i’m surprised it’s still unanswered and it seams there is still no solution to this in apache but is there a way to catch the time-out for a session?
I basicaly want a database entrie that tell’s me if the user was logged on and had his session timed out or that this is a new logon

any ideas or help will be greatly appreciated.