<@U04UQ68083H> Can I make infinite session with Or...
# ory-copilot
f
@chilly-king-10285 Can I make infinite session with Ory Kratos?
c
A message from kapa.ai
No, you cannot make an infinite session with Ory Kratos. Each session in Ory Kratos is valid for a set amount of time, known as the session's lifespan. When the session lifespan expires, the user must re-authenticate. The session lifespan is defined in the configuration and can be expressed in hours, minutes, and seconds. For example, to set the session lifespan to 30 days, you would enter
720h
in the configuration. Here is an example of how to set the session lifespan using the Ory CLI:
Copy code
bash ## List all available projects   ory list projects      ## Get config   ory get identity-config {project-id} --format yaml > identity-config.yaml
Then, update the configuration value for session lifespan property to the desired value:
Copy code
yaml session:   cookie:      domain: $<http://PROJECT_SLUG.projects.oryapis.com|PROJECT_SLUG.projects.oryapis.com>      name: ory_session_{name}      path: /      persistent: false      same_site: Lax   lifespan: 720h
Finally, update the Ory Identities configuration using the file you worked with:
Copy code
bash ory update identity-config {project-id} --file identity-config.yaml
You can find more information about session management in Ory Kratos in the [official documentation](https://www.ory.sh/docs/kratos/session-management/session-lifespan).