Skip to content

Commit a4edb32

Browse files
author
Roland Guijt
committed
Clarify/correct session expiration
1 parent d9f3c7a commit a4edb32

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

IdentityServer/v7/docs/content/ui/server_side_sessions/session_expiration.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ title: "Session Expiration"
33
weight: 20
44
---
55

6-
If a user abandons their session without triggering logout, the server-side session data will remain in the store by default.
7-
In order to clean up these expired records, there is an automatic cleanup mechanism that periodically scans for expired sessions.
6+
If the user session ends when the session cookie expires without explicitly triggering logout, there is most likely the need to clean up the server-side session data.
7+
In order to remove these expired records, there is an automatic cleanup mechanism that periodically scans for expired sessions.
88
When these records are cleaned up, you can optionally notify the client that the session has ended via back-channel logout.
99

1010
## Expiration Configuration
1111

1212
The expiration configuration features can be configured with the [server-side session options]({{<ref "/reference/options#server-side-sessions">}}).
1313
It is enabled by default, but if you wish to disable it or change how often IdentityServer will check for expired sessions, you can.
1414

15-
For example:
15+
For example, to change the interval:
1616

1717
```cs
1818
builder.Services.AddIdentityServer(options => {
@@ -21,6 +21,15 @@ builder.Services.AddIdentityServer(options => {
2121
.AddServerSideSessions();
2222
```
2323

24+
To disable:
25+
26+
```cs
27+
builder.Services.AddIdentityServer(options => {
28+
options.ServerSideSessions.RemoveExpiredSessions = false;
29+
})
30+
.AddServerSideSessions();
31+
```
32+
2433
### Back-channel Logout
2534
When the session cleanup job removes expired records, it will by default also trigger [back-channel logout notifications]({{<ref "/ui/logout/notification#back-channel-server-side-clients">}}) to client applications participating in the session. You can use this mechanism to create an [inactivity timeout]({{<ref "inactivity_timeout">}}) that applies across all your client applications.
2635

0 commit comments

Comments
 (0)