spring-projects / spring-projects/spring-framework

Support for Spring WebSession lifecycle tracking

Open
#28,164 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: web type: enhancement
Dominant language
Java
Stars
60.2k
Forks
38.8k
Avg merge
5d 2h
Merged PRs (30d)
27

Description

TL; DR;

Add support for callbacks for tracking the lifecycle of a WebSession in WebSessionStore.

Foreword

We had a use case to track journey of a WebSession. We wanted to track various aspects of it like when it was created, retrieved, saved, invalidated etc.

Problem

The session expires based on -
  1. maxIdleTime limit reached, default is 30mins
  2. maxSessions limit reached, default is 10000
  3. invalidate was called

We wanted to distinguish the sessions which were removed due to inactivity for 30mins or maxSessions limit reached.
Currently there as no such hooks for any of the methods defined in WebSession interface to track the same.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the WebSession and WebSessionStore interfaces and inspect how session creation, retrieval, saving, invalidation, and expiration are currently handled. Determine how callbacks could distinguish inactivity, maxSessions eviction, and explicit invalidation, then add focused tests covering those lifecycle events and expiration causes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.