Log user disconnection

Log user disconnection

LapointeLapointe Posts: 430Questions: 81Answers: 4

Hi.
Is there a way to log on database when user disconnect or close his browser ?
Perhaps add record each (60sec) in a rotative log (but afraid time consumption...) so when disconnected, no more log will be write and then can see last log as disconnect time...
Some idéa ?

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 61,438Questions: 1Answers: 10,049 Site admin
    Answer ✓

    This isn't really a DataTables specific question, but rather to do with your session controller. In the logout controller you could write an entry to the database there.

    Allan

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    Hi @allan
    What's matter if user close his browser directly ? Do disconnect script occurs or not (I think not). If I'm right, so I can't know if a user is disconnected or not...

  • allanallan Posts: 61,438Questions: 1Answers: 10,049 Site admin
    Answer ✓

    Yes, all session management will suffer from that. Depending on what session manager you are using, there might be some sort of timeout. Or you could use a web-socket. But that is really a question for whatever session manager software you are using.

    Allan

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    Hi @allan
    Thank for help.

    I'll log each session restart (each global action start) the time... Not very well but do the job.

    I'm more disapointed about chrome zoom...

    Bob

Sign In or Register to comment.