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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss
-~----------~----~----~----~------~----~------~--~---

Reply via email to