# \[PHP\] Timeout inactive users

**URL:** <https://forum.kirupa.com/t/php-timeout-inactive-users/107294>\
**Category:** Uncategorized\
**Created:** [April 14, 2004, 3:42am UTC](https://forum.kirupa.com/t/php-timeout-inactive-users/107294 "2004-04-14T03:42:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![comicGeek](https://avatars.discourse-cdn.com/v4/letter/c/90db22/32.png) [@comicGeek](https://forum.kirupa.com/u/comicGeek)\
**Post date:** [April 14, 2004, 3:42am UTC](https://forum.kirupa.com/t/php-timeout-inactive-users/107294/1 "2004-04-14T03:42:55Z")

</div>

Hello all. Can someone please give some sample code on how to timeout a user when he is inactive or when he closes the browser window? For example when a user logs in a value is set to true and stored in a database. when the user becomes inactive for some x minutes or when he closes the browser window the value will be set to false and he is logged out automatically. Please help!
