spring-projects/spring-session — pull request #51 by adeelmahmood (2014-10-08 23:09:42+00:00)
Title: Multiple sessions HttpSessionStrategy

I added this `HttpSessionStrategy` implementation based on your suggestion on how multiple sessions can be handled by a custom `HttpSessionStrategy`. The idea is pretty much the same as described in issue [#48](https://github.com/spring-projects/spring-session/issues/48) except the current session cookie stores the session id instead of the index. I am not sure how practical this implementation is because it relies very much on the user request including or excluding appropriate cookies to either initiate a new session, use an existing one, delete an existing session etc. Secondly having separate implementations for multiple sessions vs single sessions seems a bit odd too but may be thats ok.

As you probably hinted that having the awareness of multiple sessions in `SessionRepositoryFilter` can make it easier to manage multiple sessions. Can you share some thoughts on how automatic url rewriting can help with that. E.g in this implementation, absence of or empty current session cookie suggests the need of a new session so instead may be a request parameter can be specified and `SessionRepositoryFilter` can invoke another method on `HttpSessionStrategy` to indicate that a new session is needed regardless of existing valid session. If this implementation isnt practical please suggest how you are thinking the api can be expanded to accommodate multiple sessions. I would love to help.