# How to log out user if I don't know them?

**URL:** <https://meta.discourse.org/t/how-to-log-out-user-if-i-dont-know-them/145273>\
**Category:** Development\
**Created:** [March 23, 2020, 5:20pm UTC](https://meta.discourse.org/t/how-to-log-out-user-if-i-dont-know-them/145273 "2020-03-23T17:20:20Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)\
**Post date:** [March 24, 2020, 3:47am UTC](https://meta.discourse.org/t/how-to-log-out-user-if-i-dont-know-them/145273/6 "2020-03-24T03:47:23Z")

</div>

> [@pnoeric](#):
>
> User A walks away from the computer and their session expires automatically. They never specifically click log out in my app OR on Discourse.

> [@pnoeric](#):
>
> After a while, User A walks away from the computer and their session expires automatically.

Could you clarify what you mean by this? What is the session length for your app? How are you handling session expiration there?

Discourse has a `maximum session age` setting which by default is set to 1440 hours, which is 60 days.

The short version is that if you don’t know the user at the computer has changed, there’s nothing you can easily do to prevent it. You could dial the session length down, or periodically call from your app to log out users, but then if your users are at the computer for longer periods of time, they’re going to find themselves going back through the authentication flow.

Discourse can extend whatever login and session flow you currently use, but without more information on the above it’s hard to see exactly where the problem and any opportunities lie.

---

_[View the full topic](https://meta.discourse.org/t/how-to-log-out-user-if-i-dont-know-them/145273)._
