Kichu
Kichu

Reputation: 3267

How to check if a user is idle on a website using php

How can I check if a user is idle for 10 minutes or more using php?

Is this possible?

Upvotes: 3

Views: 1425

Answers (2)

Ibrahim Azhar Armar
Ibrahim Azhar Armar

Reputation: 25755

make use of session variable, store timestamp in it. for every request update the timestamp.

Upvotes: 0

Emil Vikström
Emil Vikström

Reputation: 91963

Each time the users does something, update a timestamp for that user in a database. To find idle users, query everyone whose timestamp is older than 10 minutes.

Upvotes: 2

Related Questions