I don't think this is supported by the TG Visit framework out of the
box. If you look at:
http://trac.turbogears.org/browser/branches/1.0/turbogears/visit/api.py#L201
you can see that the session ID is only looked for in the cookies.
Changing this without patching TG would probably require two things:
1) Providing your own VisitFilter class that patches the 'before_main'
method to retrieve the session ID from the request vars.
2) Replacing the original VisitFilter in the CherryPy filter chain
(cherrypy.root._cp_filters) with your own one. Something like:
if config.get("visit.on", False):
for i, filter in enumerate(cherrypy.root._cp_filters):
if isinstance(filter, turbogears.visit.api.VisitFilter):
cherrypy.root._cp_filters[i] = MyVisitFilter()
break
else:
cherrypy.root._cp_filters.append(MyVisitFilter())
I havn't tested it. If you try it out, please let us know, if it works ;)
Chris
Ok, so you monkey-patches VisitFilter.before_main, which is also a valid
approach, of course. Good to hear that this worked for you!
Do you reckon, one would need that patch for this flash upload recipe too?
http://digitarald.de/project/fancyupload/2-0/showcase/photoqueue/
Chris
I think we should add a patch to TG's visit module then to support
getting the session ID from the request params (if switched on in the
config). I have opened a ticket for this:
http://trac.turbogears.org/ticket/1927
> You will also need to add the patch
> that handles Flash's malformed MIME header. It seems that Flash does
> not terminate the header with a CRLF so CherryPy will timeout waiting
> for it. The patch (which is in the CherryPy repo) uses the byte count
> field to terminate.
For reference, this the ticket with the patch:
http://cherrypy.org/ticket/648
Since the CherryPy 2.x branch does not have this patch, we should
consider adding this filter on our own in the TurboGears startup code.
Chris