hey there, how do we set the Session cookie 'max-a...
# ory-network
o
hey there, how do we set the Session cookie 'max-age' in Ory Console? (we want the session cookie lifespan to be longer than non cookie sessions).
m
Hey @orange-insurance-24504 You can configure that here: https://console.ory.sh/projects/current/authentication/sessions I think for your case you would need to use the Ory CLI to edit the config directly: https://www.ory.sh/docs/guides/cli/identity-cli
```session:
cookie:
persistent: true # or false, depending on your needs
lifespan: 720h # 30 days```
If you want the session cookie to last longer than non-cookie sessions, ensure
persistent: true
and set a longer
lifespan
value.
By default, the session cookie
max-age
is the same as the set session lifespan. To disable this behavior and allow to define a different cookie
max-age
, set the
session/cookie/persistent
value to
false
Session lifespan.
Let me know if that helps.
o
Hi Vincent, thanks for your help. I have this turned on but perhaps i didn't explain what i want properly. We have a web app (uses cookie session) and a native mobile app (using session tokens). Currently, the session lifespan setting, is applied to both types of sessions. We want the mobile app sessions to last longer, for example 90 days and the web sessions to last 30 days. How do I do that?
can anyone help with this please?