Ole Jacob Hagen
waterthrill at yahoo.no
Wed Sep 21 11:50:31 EDT 2005
Hi, I am struggling with one thing......Collecting the session variables. I used to develop on debian computer, using *.psp files and *.py files. My code worked on this computer. I used python-2.3, apache-2.0.5x, and modpython-3.1.x During these days, I have tried to use the same code on a gentoo-linux box. I am using python-2.4, apache-2.0.54, and modpython-3.1.4. It seems to me that I am able to store the session variables, but not collect them. I can see from firefox (file - preferences- privacy- view cookies) that pysid-cookies have been created. Why are the cookies variable collectable? Maybe they are empty, and not writeable? Please help. Cheers, Ole J. Here is my code to save and get session variables: *def* get_session(req): req.session = Session.Session(req) req.session.load() req.session.unlock() *return* req.session *def* save_session(req,**data): req.session = get_session(req) req.session.lock() *for* key *in* data: req.session[key] = data[key] req.session.save() req.session.unlock() ***def* has_key(req,key): session = get_session(req) *if* session.has_key(key): *return* True *else*: *return* False *def* get_session_data(req,key): session = get_session(req) *if* session.has_key(key): *return* session[key] *return* {}
|