I think you'd need to have an `id` in ISession as an attribute.

You'd want it to default to 'None', then explicitly provide it in backends 
as class attribute set on __init__ or a property method.  this way all 
pyramid session objects have an 'id' attribute, but it can map to different 
values (if any) in the session storage

Client side cookies would return `None` as the id.  Server-side cookies 
would return the session value.  

problem is that i don't know how /if interfaces can have defaults , or what 
happens if you don't provide one.

some initial ideas i had were around this...

pyramid/interfaces.py:

    class ISession(IDict):
        ...
        id = Attribute('String id.  If not ``None``, the session has an 
id.')
        ...

pyramid/session.py -- and various backends --

    def __init__(self):
       self.id = foo

    or

        @property
        def id(self):
            return self['_id']


-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to