# Auth0 SPA Session TTL Part 2

**URL:** <https://community.auth0.com/t/auth0-spa-session-ttl-part-2/112731>\
**Category:** JWT.io\
**Tags:** lock, auth0\
**Created:** [August 2, 2023, 8:06pm UTC](https://community.auth0.com/t/auth0-spa-session-ttl-part-2/112731 "2023-08-02T20:06:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikhil.batta](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nikhil.batta/32/13374_2.png) [@nikhil.batta](https://community.auth0.com/u/nikhil.batta)\
**Post date:** [August 2, 2023, 8:06pm UTC](https://community.auth0.com/t/auth0-spa-session-ttl-part-2/112731/1 "2023-08-02T20:06:22Z")

</div>

Continuing the discussion from [Auth0 SPA Session TTL](https://community.auth0.com/t/auth0-spa-session-ttl/102017)

Is lock.checkSession supposed to catch this max\_age thing? I’m using the auth0lock and on intiial login I see the max\_age parameter getting passed to the authorize function (I’m setting it to 30 seconds right now for testing), what triggers this reauthentication, auth0 automatically (if so, on what function call)? or what?

Trying to figure out how to make use of the max\_age parameter.

---

<div class="post-metadata">

**Author:** ![nikhil.batta](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nikhil.batta/32/13374_2.png) [@nikhil.batta](https://community.auth0.com/u/nikhil.batta)\
**Post date:** [August 2, 2023, 9:46pm UTC](https://community.auth0.com/t/auth0-spa-session-ttl-part-2/112731/2 "2023-08-02T21:46:06Z")

</div>

It seems like if I want to have different session ttls, I either need to use this max\_age thing properly, or create new tenants (which I’d rather not).

---

<div class="post-metadata">

**Author:** ![marcelina.barycka](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marcelina.barycka/32/56162_2.png) [@marcelina.barycka](https://community.auth0.com/u/marcelina.barycka)\
**Post date:** [August 10, 2023, 2:50pm UTC](https://community.auth0.com/t/auth0-spa-session-ttl-part-2/112731/5 "2023-08-10T14:50:51Z")

</div>

Hey there @nikhil.batta,

When initialising a new [Auth0Lock](https://github.com/auth0/lock) instance, you can try to add the **options** parameter:

`new Auth0Lock(clientID, domain, options)`

which holds the `/authorize` request’s query parameters (`max_age` parameter is supposed to be added to the `/authorize` request). There might be some limitations for a specific SDK in terms of supported query parameters.

([Lock Configuration Options](https://auth0.com/docs/libraries/lock/lock-configuration#params-object-))

```auto
var options = {
  auth: {
    params: {state: 'foo'},
  }
};

```

If added when initialising a new Auth0Lock instance, there’s no need to repet it when calling [checkSession()](https://auth0.com/docs/libraries/lock/lock-api-reference#checksession-) method.

I didn’t test it myself but based on the documentation, these are the only [supported parameters](https://auth0.com/docs/libraries/lock/lock-authentication-parameters#supported-parameters) for the **auth0-lock** library.

If you have a chance to test it out, please let us know how it goes. Thanks!

---

<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:** [August 28, 2023, 8:52am UTC](https://community.auth0.com/t/auth0-spa-session-ttl-part-2/112731/7 "2023-08-28T08:52:58Z")

</div>

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