# Correlation of the appSession cookie expiration and the Auth0 Server Side session

**URL:** <https://community.auth0.com/t/correlation-of-the-appsession-cookie-expiration-and-the-auth0-server-side-session/91738>\
**Category:** Get Help\
**Tags:** express-jwt, express, openidconnect, auth0\
**Created:** [October 3, 2022, 9:50pm UTC](https://community.auth0.com/t/correlation-of-the-appsession-cookie-expiration-and-the-auth0-server-side-session/91738 "2022-10-03T21:50:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![parisapostolopoulos](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/parisapostolopoulos/32/33718_2.png) [@parisapostolopoulos](https://community.auth0.com/u/parisapostolopoulos)\
**Post date:** [October 3, 2022, 9:50pm UTC](https://community.auth0.com/t/correlation-of-the-appsession-cookie-expiration-and-the-auth0-server-side-session/91738/1 "2022-10-03T21:50:51Z")

</div>

Hello, I have a basic question, I guess is mostly around understanding and verifying certain aspects of our implementation.

I am using the express open id connect - [GitHub - auth0/express-openid-connect: An Express.js middleware to protect OpenID Connect web applications.](https://github.com/auth0/express-openid-connect) in order to implement Auth, backed by Auth0 on a React/SPA setup.

My question relates to the nature of the cookie aka `appSession` that is dropped by the middle ware upon successful login and the Auth0Session.

On the openId connect library we use the defaults in terms of cookie expiration and policy as defined here. `https://github.com/auth0/express-openid-connect/blob/master/V2_MIGRATION_GUIDE.md#session-lifecycle-configuration` and the cookie works as expected.

What is not clear to us is how the different settings on the expiration of the client side cookie aka `appSession` cookie - reflect or not to the actual Auth0 Session.

For example.

We have set our cookie to with the following settings.

- Absolute expiry policy 1 month. So once you login the appSession cookie is dropped to the browser and the expiration policy is 1 month.

At the same time on the Auth0 tenant - we have the following setting. Settings \> Advanced \> Persistent Session.

- Inactivity timeout : 1m
- Require after login : 30m

Its not really clear to me how this works with the underlying Auth0 Session.

Since our `appSession` cookie is set to expire in 1 month, we can see the as an end user practically I am logged in for 1 month and I am not required to login again.

But we have a feeling this is not the correct use of the cookie + session. We would like to make use of the Auth0 long lived session.

So my main question is how is the appSession cookie correlate with the Auth0 Session?  
If I reset my cookie expiration policy to some defailts - e.g one day - how shall I take advantage of the Auth0 long live session? Is it a matter of just increasing the - Inactivity timeout to 1 month for example?

---

<div class="post-metadata">

**Author:** ![parisapostolopoulos](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/parisapostolopoulos/32/33718_2.png) [@parisapostolopoulos](https://community.auth0.com/u/parisapostolopoulos)\
**Post date:** [October 4, 2022, 1:26pm UTC](https://community.auth0.com/t/correlation-of-the-appsession-cookie-expiration-and-the-auth0-server-side-session/91738/2 "2022-10-04T13:26:55Z")

</div>

It seems that there is no correlation between the openId connect appSession cookie and the Auth0 Long session as validated by one of the maintainers.

> <https://github.com/auth0/express-openid-connect/issues/393>
>
> \### Describe the problem you'd like to have solved
> 
> Slightly better documentat…ion on the correlation of the \`appSession\` client side cookie and the Auth0 Session (server side) life cycle. 
> 
> \### Describe the ideal solution
> 
> Improvement on documentation or some extra clarification
> 
> \### Additional information, if any
> 
> My request starts from this basic question. See also here: https://community.auth0.com/t/correlation-of-the-appsession-cookie-expiration-and-the-auth0-server-side-session/91738?u=parisapostolopoulos
> 
> 
> Hello, I have a basic question, I guess is mostly around understanding and verifying certain aspects of our implementation.
> 
> I am using the express open id connect - \[GitHub - auth0/express-openid-connect: An Express.js middleware to protect OpenID Connect web applications.\](https://github.com/auth0/express-openid-connect) in order to implement Auth, backed by Auth0 on a React/SPA setup.
> 
> My question relates to the nature of the cookie aka appSession that is dropped by the middle ware upon successful login and the Auth0Session.
> 
> On the openId connect library we use the defaults in terms of cookie expiration and policy as defined here. https://github.com/auth0/express-openid-connect/blob/master/V2\_MIGRATION\_GUIDE.md#session-lifecycle-configuration and the cookie works as expected.
> 
> What is not clear to us is how the different settings on the expiration of the client side cookie aka appSession cookie - reflect or not to the actual Auth0 Session. On the Auth0 tenant we have the \`Persistent session option selected\`
> 
> Example:
> 
> We have set our cookie to with the following settings. Absolute expiry policy 1 month. 
> So once you login the appSession cookie is dropped to the browser and the expiration policy is 1 month.
> 
> At the same time on the Auth0 tenant - we have the following setting. (Settings \> Advanced\> Persistent Session)
> 
> Inactivity timeout : 1m
> Require after login : 30m
> 
> Its not really clear to me how this works with the underlying Auth0 Session.
> 
> Since our appSession cookie is set to expire in 1 month, we can see the as an end user practically I am logged in for 1 month and I am not required to login again. But we have a feeling this is not the correct use of the cookie + session. We would like to make use of the Auth0 long lived session.
> 
> \`So my main question is how is the appSession cookie correlate with the Auth0 Session?\`
> 
> If I reset my cookie expiration policy to some defailts - e.g one day - how shall I take advantage of the Auth0 long live session? Is it a matter of just increasing the - Inactivity timeout to 1 month for example?
> 
> Thanks for any tips

---

<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:** [October 18, 2022, 1:27pm UTC](https://community.auth0.com/t/correlation-of-the-appsession-cookie-expiration-and-the-auth0-server-side-session/91738/3 "2022-10-18T13:27:16Z")

</div>

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