# Is there a way to set session expiration after a set length of time?

**URL:** <https://meta.discourse.org/t/is-there-a-way-to-set-session-expiration-after-a-set-length-of-time/13769>\
**Category:** Feature\
**Created:** [March 16, 2014, 12:46am UTC](https://meta.discourse.org/t/is-there-a-way-to-set-session-expiration-after-a-set-length-of-time/13769 "2014-03-16T00:46:31Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![davidcelis](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/davidcelis/32/454421_2.png) [@davidcelis](https://meta.discourse.org/u/davidcelis)\
**Post date:** [March 16, 2014, 5:34pm UTC](https://meta.discourse.org/t/is-there-a-way-to-set-session-expiration-after-a-set-length-of-time/13769/3 "2014-03-16T17:34:25Z")

</div>

At this point, you’d basically need to set a custom CurrentUserProvider in a plugin. Check out the [default current user implementation](https://github.com/discourse/discourse/blob/master/lib/auth/default_current_user_provider.rb) to get an idea of how they currently set the current user. You could probably copy most of that but set an expiry on the cookie.

---

_[View the full topic](https://meta.discourse.org/t/is-there-a-way-to-set-session-expiration-after-a-set-length-of-time/13769)._
