[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=\"testing.py?sessID="+relace.id()+"\">Reload</a>")
>
>
> 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