[mod_python] Session Cookie Name

Robert Wallner kodixos at gmail.com
Thu Oct 6 09:21:36 EDT 2005


On 10/6/05, Graham Dumpleton <grahamd at dscpl.com.au> wrote:
>
>
> On 06/10/2005, at 9:44 PM, Robert Wallner wrote:
>
> >
> >
> > On 10/6/05, Graham Dumpleton <grahamd at dscpl.com.au> wrote:
> >> Can't check source code at the moment, but If this is changing
> >> the global cookie name it would be a dangerousthing to do
> >> from within an actual handler.
> >>
> >
> > Of course, I forgot to mention that. I am changing the cookie
> > name at the top of the module containging the handler function.
>
> If you mean at global scope within the module, ie., it would only be
> done at time of import of the handler module, would still be potentially
> dangerous as requests could arrive for other handlers before your
> handler is imported. When I said "handler" I meant anywhere in the
> handler module, not just the handler function.
>
> I'll agree that it will not be a problem if your handler is the only
> handler defined for that interpreter instance, but if you are running
> multiple handlers of your own or sharing with others, the only reliable
> way of doing this, if you really want to do it this way, is to do it
> from a module imported using PythonImport before any requests are
> handled.
>
> Graham
>
>
You couldn't explain it better, sorry if I confused anyone. In my case, I
have exactly one handler in a main module. At the top of that module, I
initialize my system, like reading configuration files, connecting to the
database, change cookie name, etc. But then, this is correct only for this
case, ie a single handler.

--
Robert Wallner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20051006/104be4d9/attachment-0001.html


More information about the Mod_python mailing list