`call.sessions.set(UserPrincipal(user.id))` Is th...
# ktor
y
call.sessions.set(UserPrincipal(user.id))
Is there a way to update session? Calling sessions.set is regenerating sessionId in the cookie / store which kinda messes up our data logging.
a
Can you share your configuration of the installed Sessions plugin?
You can use your own function for generating the session ID by passing it to the
identity
method of the
CookieIdSessionBuilder
or
HeaderIdSessionBuilder
. Here is an example:
Copy code
cookie<SessionData>("session", SessionStorageMemory()) {
    identity {
        "myID"
    }
}
This way, you will control regeneration of the session ID.
👍🏾 1
m
How can I read/write session attributes from Redis Cache
a
By implementing the
SessionStorage
interface.