Persisting sessions with axum-login and redis

⚓ Rust    📅 2025-11-12    👤 surdeus    👁️ 6      

surdeus

Warning

This post was published 36 days ago. The information described in this article may have changed.

Hello folks!

I am building a small server with axum-login. I replaced the MemoryStore by a RedisStore, following the example in tower-sessions-stores/redis-store.

I was expecting sessions to survive a server restart, but they do not. Is that expected or am I missing something?

Inspecting redis, I can see that the cookie is persisted when the server is down. Yet when I run it again, as soon as I run a query the cookie is being removed by axum-login.

I did not manage to decode the redis key but it seems some parts are changing (not only the argon2d sha).

Shouldn't sessions be persisted over server restart?

1 post - 1 participant

Read full topic

🏷️ Rust_feed