It's a shame people don't get WSGI middleware, as this is another classic example of where it'd work wonderfully. Besides for making this functionality easily usable by any WSGI compatible framework, it'd open the doors to tie this ID back into other middleware such as the Open ID authentication middleware now in Paste.
There's definitely places where things make more sense to implement as a middleware layer, rather then pushing more and more components into the framework. Pushing things like this into separate packages also makes it easier to upgrade them independently of the framework so important updates/fixes can be pushed out without requiring the user to upgrade the whole framework. TurboGears does a great job re-using other projects, it only makes sense that when appropriate new re-usable projects should be created if functionality can easily be setup independently of the framework.

