How Rails SessionStore Middleware is loaded

Hi,

I'm trying to trace and debug a problem in one of my applications
regarding a session that keeps getting lost. I've managed to follow
it through the stack by doing some debugging output in the call
methods of the various rack middlewares, and ended up as somewhere
between the ActionDispatch::Cookies and ActiveRecord::SessionStore
middleware area. However, I noticed that in Rails 3.1.0.rc4, I can't
seem to find any sort of call method anywhere like the other
middlewares.

Can anyone explain exactly how these middlewares are loaded up if they
don't have a call method as required by rack? I'm sure it's something
I may be overlooking.