Re: Publisher, how to handle sessions

Graham Dumpleton <[email protected]>
Newsgroups gmane.comp.python.mod_python
Message-ID <[email protected]>
You will get deadlock doing that.

In the publisher function assign the session to:

  req.session

and not a local variable.

By assigning it to req.session, PSP code will see it and use it rather
than trying to create a new one and causing a deadlock.

Graham

2009/3/3 Mihamina Rakotomandimby <[email protected]>:
> Hi
> My .htaccess:
> http://lab.vectoris.fr/projects/vectoris/browser/EncycloPyDia/trunk/.htaccess
> My Python file:
> http://lab.vectoris.fr/projects/vectoris/browser/EncycloPyDia/trunk/index.py
>
> Two templates:
> http://lab.vectoris.fr/projects/vectoris/browser/EncycloPyDia/trunk/index.html
> http://lab.vectoris.fr/projects/vectoris/browser/EncycloPyDia/trunk/index_2.html
>
> Please, these files are crappy, just for testing purpose, disable your
> --pedant flag ;-).
>
> I see the session mecanism working with those files:
> If a session['login'] is set, then it's OK.
>
> When using PSP handler (not the Publisher) just using a variable named
> "session" is enough to handle sessions. Here, I had to instanciate one in
> each function.
> On the other hand, I saw forms are very easily handled, they are
> automagically set to variables.
>
> Is there a way, using the Publisher, to easily handle sessions?
>
> My real goal is to use templating-like code, just like this one given in
> example, _and_ easily handle forms and session. I do want to use mod_python
> (just mod_python, nothig more): the publisher might not be the best
> approach?
>
> Thank you!
>
> --
> Chef de projet chez Vectoris
> http://www.google.com/search?q=mihamina+rakotomandimby
> Telephone: +261 33 11 207 36
> _______________________________________________
> Mod_python mailing list
> [email protected]
> http://mailman.modpython.org/mailman/listinfo/mod_python
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.