Matthieu Stombellini
08/03/2020, 7:37 PMCasey Brooks
08/03/2020, 7:49 PMdirectorySessionStorage
, but you can write your own storage mechanism as well). If you do not provide session storage, then the entire session contents are serialized and saved in that cookie instead. https://ktor.io/servers/features/sessions.html#directorySessionStorage
You can also customize whether it expects that session ID to be in a cookie or a specified header https://ktor.io/servers/features/sessions.html#cookie-vs-headerCasey Brooks
08/03/2020, 7:51 PMMatthieu Stombellini
08/03/2020, 7:57 PMstate
parameter in the URL, as I'm trying to retrieve my state upon an OIDC Provider's redirection to my server), not through the headerCasey Brooks
08/03/2020, 8:09 PMstate
parameter from the call set it to the normal header/cookie session in the request handler, since query parameters are not persistent. call.sessions.getOrSet
is helpful here
get("/redirect") {
val session: AppSession = call.sessions.getOrSet {
val sessionId = call.parameters["state"]!!
AppSession(sessionId)
}
}
arjun
08/04/2020, 10:01 AMCasey Brooks
08/04/2020, 2:23 PMarjun
08/04/2020, 3:19 PM