Tobias Grether
09/25/2026, 12:52 PMval SESSION_PLUGIN_SESSION_ATTRIBUTE_KEY = AttributeKey<String>("SessionId")
val session = call.sessions.get<MySession>()
call.sessions.clear<MySession>()
call.attributes.remove(SESSION_PLUGIN_SESSION_ATTRIBUTE_KEY)
call.sessions.set(session)
Which is quite hacky and I have not even checked so far for side effects.
Is there a better way for this?
Previously reported here: youtrack.jetbrains.com/issue/KTOR-675/Regenerate-session-id?_gl=….
For reference: the attribute key is taken from here: github.com/ktorio/ktor/blob/…/SessionTrackerById.kt#…Aleksei Tirman [JB]
09/25/2026, 1:43 PM