# How to verify the user session periodically

**URL:** <https://community.auth0.com/t/how-to-verify-the-user-session-periodically/82185>\
**Category:** Get Help\
**Created:** [April 22, 2022, 4:58am UTC](https://community.auth0.com/t/how-to-verify-the-user-session-periodically/82185 "2022-04-22T04:58:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![frnlucas](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/frnlucas/32/36801_2.png) [@frnlucas](https://community.auth0.com/u/frnlucas)\
**Post date:** [April 22, 2022, 4:58am UTC](https://community.auth0.com/t/how-to-verify-the-user-session-periodically/82185/1 "2022-04-22T04:58:34Z")

</div>

I want to periodically check the user session. I’m using Gatsby, my implementation basically do a silent auth when the gatsby-browser.js mounts.  
I want to periodically check the user session.  
I’m using auth0-js 9.14.0.

```auto
handleCheckSession = () => {
    this.setState({ loading: false })
  }

  componentDidMount() {
    silentAuth(this.handleCheckSession)
  }

```

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [April 22, 2022, 11:32pm UTC](https://community.auth0.com/t/how-to-verify-the-user-session-periodically/82185/3 "2022-04-22T23:32:53Z")

</div>

Hi @frnlucas ,

Welcome to the Auth0 Community!

I understand that you want to periodically check use session. Auth0 SDK has checkSession method. Details are here. Hope [this](https://github.com/auth0/auth0.js#checksessionoptions-callback) helps!

---

<div class="post-metadata">

**Author:** ![lihua.zhang](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/lihua.zhang/32/39683_2.png) [@lihua.zhang](https://community.auth0.com/u/lihua.zhang)\
**Post date:** [February 1, 2023, 11:11pm UTC](https://community.auth0.com/t/how-to-verify-the-user-session-periodically/82185/4 "2023-02-01T23:11:21Z")

</div>


