spray-session icon indicating copy to clipboard operation
spray-session copied to clipboard

Problem for Invalidation/Expiration Callback.

Open imcharsi opened this issue 9 years ago • 1 comments

Hi.

At first, My English is poor. I'm sorry about that.

While I tried this spray-session, I thought that I found something strange behavior.

In this implementation, we can register arbitrary callbacks for session invalidation/expiration.

So I tried this. In InMemorySessionManager's session expiration, It looks like that this callback was not called.

My idea about why is

  1. Start at CleanUp in Here
  2. Delete the expired session from session map in Here
  3. The code try to find the already deleted session in session map in Here

My suggestion is

case class Invalidate(String, Option[Map[String, Session[T]]])

instead of

case class Invalidate(String)

Thanks.

imcharsi avatar Jul 21 '15 18:07 imcharsi

P.S. I didn't write any test about this suggestion. Sorry about that.

imcharsi avatar Jul 21 '15 18:07 imcharsi