# User is logged out after one day

**URL:** <https://community.auth0.com/t/user-is-logged-out-after-one-day/108916>\
**Category:** Get Help\
**Tags:** rotating-refresh-tokens, sessions\
**Created:** [June 8, 2023, 9:17pm UTC](https://community.auth0.com/t/user-is-logged-out-after-one-day/108916 "2023-06-08T21:17:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vishnu.shanker.au](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@vishnu.shanker.au](https://community.auth0.com/u/vishnu.shanker.au)\
**Post date:** [June 8, 2023, 9:17pm UTC](https://community.auth0.com/t/user-is-logged-out-after-one-day/108916/1 "2023-06-08T21:17:30Z")

</div>

![Auth0 Config](https://global.discourse-cdn.com/auth0/original/3X/8/8/8859d70ffe7a70b24ea81856918c029301e18b86.png)  
I use the React Native SDK to signup/login the user. The user gets logged out automatically the next day when he opens the app again. I have set all the limits to maximum allowed in auth0 config. PFA screenshot. I would like the user to be logged in for atleast 15 days.

Here is the code snippet

import { useAuth0 } from ‘react-native-auth0’;

```
const { user, isLoading } = useAuth0();

useFocusEffect(
    useCallback(() => {
        checkUserAuth()
    }, [])
)

useEffect(() => {
    if (!isLoading) {
        checkUserAuth()
    }
}, [isLoading])

```

const checkUserAuth = async () =\> {  
const token = await AsyncStorage.getItem(‘user\_token’)  
if (!token) {  
moveUserToLoginPage()  
}

```
    if (isLoading) {
        return
    }
    try {
        if (user) {
            setLoading(true)
            actions.GetDashboard({})
        } else {
            await moveUserToLoginPage()
        }
    } catch (e) {
        console.error('error in checkUserAuth', e)
        setLoading(false)

    }
}

```

I tired printing the refresh token and its null after doing a fresh login.

```
    const credentials = await getCredentials()

```

“Null here in the refresh token”

How do I solve this? Thanks in advance.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [June 21, 2023, 3:26pm UTC](https://community.auth0.com/t/user-is-logged-out-after-one-day/108916/3 "2023-06-21T15:26:06Z")

</div>

Hi @vishnu.shanker.au,

Welcome to the Auth0 Community!

Thank you for sharing a detailed problem statement.

Have you configured the session lifetimes for your tenant?

> **[Configure Session Lifetime Settings](https://auth0.com/docs/manage-users/sessions/configure-session-lifetime-settings)**
>
> Describes how to configure session lengths and limits for a tenant using the Auth0 Dashboard or the Management API.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [July 20, 2023, 3:35pm UTC](https://community.auth0.com/t/user-is-logged-out-after-one-day/108916/4 "2023-07-20T15:35:33Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
