This message was deleted.
# ktor
s
This message was deleted.
đź“ť 1
d
Have you set the
cookie.path
?
try to set
cookie.path = "/"
v
Sorry, I did a mistake in my question, I use header instead of cookie
d
What do you mean by “the clear didn’t work”?
Are you using client-side or server-side sessions?
Where is the payload stored?
v
I use server-side
d
And which storage?
The problem is that qhen you restart the server the session is lost? Or what?
v
No When the user call the route logout, I call the clear method. But If I call another route with the same heder, that’s work instead of said this headers was cleared
I don’t know if it’s clear sorry
I’m sorry It was a called I didn’t see I will delete this post, thanks
d
Okay. Np. No need to delete it
v
Sorry, Already did
And when your store the session, If the user don’t logout, The session will remain on the disk for ever ?
d
Depending on the storage you use
you can prune files on disk based on last write or last access
you can also store the sessions in a database or redis. There is an example of this here: https://github.com/soywiz/ktor-cio-clients/blob/master/ktor-server-sessions-redis/src/io/ktor/experimental/sessions/redis/RedisSessionStorage.kt#L43 This redis version does autoprunning by using a TTL using the expire command from here: https://redis.io/commands/expire