franckcuny/dancer-session-psgi — pull request #2 by jwittkoski (2012-07-09 22:27:20+00:00)
Title: Cookie fixes

I noticed two behaviors with Dancer::Session::PSGI that I thought should be changed:

* The dancer.session cookie is still always created, but with a different value every time.
* The PSGI session gets a random "id" key added/replaced every time the session DSL keyword is used.

These seems to be side effects of the fact that the implementation of Dancer::Session assumes that it should be managing the cookies directly. Which is a reasonable expectation for almost all the Dancer::Session::* modules - except for this one since Plack::Middleware::Session is doing it.

These changes override the default behavior of init, read_session_id and write_session_id so that the existing Dancer::Session code does not create new session objects or cookies.

These changes also include:
* A destroy method similar to the changes @tomi-ru did in issue #1.
* Keys whose value is null are removed from the session store.