Description
I spent a lot of time reviewing the code and it's quite confusing to me why the Rack::Tracker#call method does this swap of moving the tracker hash in and out of the session. Because of this, if the request is not HTML, the tracker never gets stored in the session. Another question I have is why not just store the tracker hash in the session from the start? This swapping from env['tracker'] to the session['tracker'] just seems overly complex and I can't understand the purpose.
From what I can tell this seems to be the cause that remote forms and any AJAX request that redirects never get the events executed in the next HTML request. Since the Rack::Tracker#call method returns unless the request is HTML the env['tracker'] never moves into the session['tracker']. This means the events are just lost.
It appears #79 brings this issue up and #133 brings up a possible solution. #133 would be the most ideal solution but it's likely a pain and requires additional templates for every handler.
Right now I'm working on making this work using just the session and I'll submit a pull request. Just wanted to get the discussion started on this since I'm not sure why the session wasn't always just directly used.