ktorio / ktor

Framework for quickly creating connected applications in Kotlin with minimal effort

Home Page:https://ktor.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to get session from cache: `IllegalStateException: Daemon thread is already dead`

kobevaliant opened this issue · comments

Hi
Recently I encountered this exception several times, I thought it may be a bug about session.

1

Hi @kobevaliant, thanks for the report.
Could you share the snippet to help reproduce the problem?

Hi
I used session like following, which is very simple

// session object
data class FfpSession(val userId: String)

//install session
install(Sessions) {
        cookie<FfpSession>(
            "SESSION_ID",
            directorySessionStorage(File(".sessions"), cached = true)
        ) {
            cookie.path = "/"
        }
}

//use
val session = sessions.get<FfpSession>()

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

Fixed since 1.5.0