[mod_python] Sessions

Nathan Olberding nathan.olberding at gmail.com
Thu Jun 2 18:42:31 EDT 2005


In whatever function:

session = Session.Session(req)
session["foo"] = "This is the foo string"
session.save()

Then, in the function that generates the next page:

session = Session.Session(req)
session.load()
# Now, session["foo"] should equal "This is the foo string"

I'm definitely a beginner with mod_python and all other types of web
scripting, too, but I copied and pasted this from working code (I
wrote it once, and once it worked right, I forgot how I got it to
work... need to go back and perma-learn it). Someone else on this
list, please correct me if I'm wrong.


On 6/2/05, Timothy Kendall <tkendall at cnri.reston.va.us> wrote:
> Sorry for posting such a beginner's question, but...
> 
> I've been using Python for some time, but I'm new to mod_python.  I need to learn how to implement sessions.  I've been through section 4.8 of the mod_python manual, but what's there doesn't tell me how to proceed (not so that my admittedly deficient mind can grasp it, anyway).  Is there a step-by-step xplanation anyone can point me to?  Seems like there must be, but I can't seem to find one.
> 
> Thank you.
> 
> Timothy Kendall
> 
> 
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
> 


-- 
-NKO-



More information about the Mod_python mailing list