Repository navigation
fix(example): set Redis TTL on session keys using absoluteDuration - #54
Merged
Merged
Conversation
nandan-bhat
force-pushed
the
fix/redis-store-ttl
branch
from
September 24, 2026 14:44
d886015 to
c7af3f3
Compare
Without EX, sessions persist indefinitely in Redis even after the SDK considers them expired. Compute remaining TTL from createdAt + absoluteDuration - now so keys expire at the correct wall-clock time. Apply the same TTL to the sid index key. Thread absoluteDuration through the store factory so the Redis TTL stays in sync with sessionConfiguration.
nandan-bhat
force-pushed
the
fix/redis-store-ttl
branch
from
October 7, 2026 18:04
c7af3f3 to
6504f07
Compare
nandan-bhat
previously approved these changes
Oct 7, 2026
Resolve the redis-store.ts conflict in the migration example. main (#53) re-keyed the backchannel logout index to session:<sid>:<sub> and gated the index write/delete on both sid and sub; this branch (#54) adds a TTL (createdAt + absoluteDuration) to the session and index keys. The merged set() keeps the sub+sid keying and applies the same EX ttl to the index key, so both fixes hold together. Co-Authored-By: Claude <noreply@anthropic.com>
nandan-bhat
previously approved these changes
Oct 7, 2026
…tion runbook The backchannel-logout index was renamed to session:<sid>:<sub> in #53, but the Scenario 2 steps still referenced logout:sid:<sid>, so `redis-cli keys 'logout:sid:*'` returned nothing and the "confirm the index key exists" step could not succeed. Point the runbook at the current key name and `keys 'session:*'`. Also note that session and index keys now carry a Redis TTL (createdAt + absoluteDuration): add a verification step using `redis-cli ttl` and mirror the expiry behavior into the redis-store.ts docstring. Co-Authored-By: Claude <noreply@anthropic.com>
cschetan77
previously approved these changes
Oct 8, 2026
…e.ts Co-authored-by: Chetan Sharma <chetan.sharma@okta.com>
cschetan77
approved these changes
Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
set()in the Redis store example had noEXoption, so session keys persisted indefinitely even after the SDK considered them expiredcreatedAt + absoluteDuration - nowso keys expire at the correct wall-clock time regardless of how many times the session is writtenlogout:sid:<sid>index keyabsoluteDurationthroughcreateRedisSessionStore(defaulting to the SDK's own default of 3 days) so the Redis TTL stays in sync withsessionConfiguration