3 messages in com.googlegroups.pylons-discussquestoin on sessions| From | Sent On | Attachments |
|---|---|---|
| jose | 29 Jun 2006 12:02 | |
| Alexandre CONRAD | 29 Jun 2006 12:11 | |
| Jose Galvez | 29 Jun 2006 14:58 |
| Subject: | questoin on sessions![]() |
|---|---|
| From: | jose (jj.g...@gmail.com) |
| Date: | 06/29/2006 12:02:28 PM |
| List: | com.googlegroups.pylons-discuss |
I am rewriting one of my old web applications to use pylons, I've installed one of the recent svn builds (a few days old now). the site makes heavy use of sessions, but I think I must be doing something wrong as I can't read the session once I've set it. Here is a real simple example of what does not work:
================================================================ from home2.lib.base import *
class SessController(BaseController): def index(self): return response('please user set and get')
def set(self): session['name'] = 'jose' return response('session set')
def get(self): name = session['name'] return response('you name is %s' % name)
=============================================================== so if I run localhost:5000/sess/set it looks like it works, however if I then try localhost:5000/sess/get I get an error: return self._session()[key] Module myghtyutils.session:135 in __getitem__ exceptions.KeyError: 'name' .
So am I using sessions correctly? or am I using them incorrectly, and if so how do you use sessions with pylons?
Thanks in advance for any and all help Jose
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to pylo...@googlegroups.com
To unsubscribe from this group, send email to
pylo...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/pylons-discuss
-~----------~----~----~----~------~----~------~--~---




