[mod_python] Sessions again...

Luis M. Gonzalez luismg at gmx.net
Thu Jan 19 16:49:11 EST 2006


Hi folks,

I made significant progress since I started playing with mod_python last week-end,
and I created a shopping cart and a script for handling pagination of recorsets with record navigation bars.
Everything works great, except for one little problem:

If I test one of these scripts (any of them), it works great, but if I test the other one without restarting the browser, I get a strange error message that, I guess, has to do with session variables.
This is the error message:

Mod_python error: "PythonHandler mod_python.psp"

Traceback (most recent call last):

  File "C:\Python24\Lib\site-packages\mod_python\apache.py", line 299, in HandlerDispatch
    result = object(req)

  File "C:\Python24\Lib\site-packages\mod_python\psp.py", line 302, in handler
    p.run()

  File "C:\Python24\Lib\site-packages\mod_python\psp.py", line 213, in run
    exec code in global_scope

  File "C:/Archivos de programa/Apache Group/Apache2/htdocs/test/zzxx.psp", line 18, in ?
    tmpl.run(vars = {   'dbmodule': dbmodule,

  File "C:\Python24\Lib\site-packages\mod_python\psp.py", line 213, in run
    exec code in global_scope

  File "C:/Archivos de programa/Apache Group/Apache2/htdocs/test\recset.tmpl", line 111, in ?
    r.counter = s['counter']

KeyError: 'counter'
Here, "counter" is a session variable I defined in one of these scripts.
If I test the other script first and then this one, I get the same error message, but instead of pinting to "counter", it points to "items", which is the other session variable.

Summing up:
Each script works great when tested first, but the second one gives me this error message.
On the other hand, If I test them separately (restarting the browser for each one), they both work great.

What could be the problem?
Any hint would be highy appreciated...

Best regards,
Luis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20060119/0c3a9f35/attachment.html


More information about the Mod_python mailing list