rack/rack — Issue #266: Set-Cookie header is set even though existing session did not change
Author: choonkeat
Created: 2011-11-17 09:18:31+00:00
State: open

The current spec ``does not return a cookie if cookie was not written (only read)`` has a ``SessionHash`` that returns ``false`` on ``session_exists?``. i.e. ``load_for_read!`` never actually called ``load!``

If it had, then ``@loaded`` would've been ``true``, making ``ID#commit_session?`` true and thus setting the ``Set-Cookie`` header

If we were to make the session exist, and test for a nil ``Set-Cookie`` header, it would fail. See choonkeat/rack@e2f1c433c14f7cc4a01a235264f5a7a017659812

On a related note, this is causing all Rails responses to issue ``Set-Cookie`` once there is a session