limited-city-59768
03/07/2024, 6:57 AMchilly-king-10285
03/07/2024, 6:57 AMchilly-king-10285
03/07/2024, 6:57 AMbash ## List all available projects ory list projects ## Get config ory get identity-config {project-id} --format yaml > identity-config.yaml
2. Update the configuration value for the session lifespan property to the desired value. The session lifespan is expressed in hours, minutes, and seconds. Use a combination of these units to define the desired lifespan. For example: 72h
, 10m
, 12s
, 1h13m3s
. Here is an example of how to set the session lifespan to 30 days (720 hours): yaml session: cookie: domain: {project.slug}.<http://projects.oryapis.com|projects.oryapis.com> name: ory_session_{name} path: / persistent: false same_site: Lax lifespan: 720h
3. Update the Ory Identities configuration using the file you worked with: bash ory update identity-config {project-id} --file identity-config.yaml
After these steps, each session will be valid for the set amount of time. When the session lifespan expires, the user must re-authenticate. For more details, you can refer to the [Ory Kratos documentation](https://www.ory.sh/docs/kratos/session-management/session-lifespan).limited-city-59768
03/07/2024, 6:59 AMchilly-king-10285
03/07/2024, 6:59 AMchilly-king-10285
03/07/2024, 6:59 AMkratos.yml
or kratos.json
. Here's an example of how to set the session lifespan in the configuration file: yaml session: lifespan: 720h
This sets the session lifespan to 30 days (720 hours). The lifespan is expressed in hours (h
), minutes (m
), and seconds (s
). You can use a combination of these units to define the desired lifespan. After updating the configuration file, you need to restart your Kratos service for the changes to take effect. Please refer to the [Ory Kratos documentation](https://www.ory.sh/docs/kratos/session-management/session-lifespan) for more details.