[mod_python] Session example and problems.

Chris Jackson christopher.jackson at gmail.com
Thu Feb 24 17:02:56 EST 2005


http://www.modpython.org/pipermail/mod_python/2005-January/017111.html

~= Chris =~


On Thu, 24 Feb 2005 15:55:22 -0500, donnie jones
<donniejones18 at gmail.com> wrote:
> Hello,
> 
> Could someone please give me an example of using the Session()
> in modpython for passing data between functions?
> I have been googling, but with no success..
> 
> The problem I am having is that each time I reload a page that calls
> the function like below, it creates a new session.
> 
> def test(req):
>   sess = Sess(req);
>   sid = sess.id();
>   if sess.is_new():
>     req.write("new session %s" % sid);
>   else:
>     sess.load();
>     req.write("%s" % sess['username']);
> 
> I am printing the session id and each time the function is loaded
> I get a new session id, thus I cannot store data in the session
> to use in other functions...
> 
> Thank you.
> __
> Donnie
> _______________________________________________
> 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