Skip to content

InMemoryWebSessionStore method to access map of sessions [SPR-16713] #21254

@spring-projects-issues

Description

@spring-projects-issues

Jan Truksa opened SPR-16713 and commented

Would it be possible to have in org.springframework.web.server.session.WebSessionStore method like:

Mono<Map<String, WebSession>> getSessions()

With default implementation like:

public Mono<Map<String, WebSession>> getSessions() {
	return Mono.just(Collections.unmodifiableMap(sessions));
}

The thing I'm going to do is simple session management like list all active sessions, manually invalidate session by admin, etc. Obviously, I can just re-implement some implementation of WebSessionStore like InMemoryWebSessionStore and use this implementation in my application, but I would appreciate some native support.

On the other hand is it even good practice to expose sessions like this, when there isn't native support?


Affects: 5.0.7

Issue Links:

Referenced from: commits 6218db9, 43fbd63

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions