# Last online datetime for user

**URL:** <https://forum.heroiclabs.com/t/last-online-datetime-for-user/5698>\
**Category:** Runtime Framework\
**Tags:** users\
**Created:** [October 10, 2024, 9:52am UTC](https://forum.heroiclabs.com/t/last-online-datetime-for-user/5698 "2024-10-10T09:52:55Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [October 22, 2024, 3:43pm UTC](https://forum.heroiclabs.com/t/last-online-datetime-for-user/5698/2 "2024-10-22T15:43:06Z")

</div>

Hello @jell-o-fishi,

Nakama does not keep track of this automatically, a way of doing it would be to store a timestamp of last activity in the account metadata or a storage object (or use the object built in `update_time`) within an RPC you know the user will call as part of his play session (but that would not put a lot of pressure by updating this object too often).

Another is to have a before or after hook in one of the Authentication functions and SessionRefresh functions (to make sure that a Refresh will also trigger the update).

Best.

---

_[View the full topic](https://forum.heroiclabs.com/t/last-online-datetime-for-user/5698)._
