Changeset 42:b66e245d5b19

Show
Ignore:
Timestamp:
11/10/06 16:38:02 (2 years ago)
Author:
Allan Saddi <allan@saddi.com>
branch:
default
convert_revision:
svn:46762da8-4eb7-0310-94e9-d918b60927c8/flup/trunk@2104
Message:

Add cookieAttributes to SessionService? to make it easier
to customize the generated cookie's attributes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ChangeLog

    r41 r42  
     12006-11-10  Allan Saddi  <asaddi@europa.saddi.net> 
     2 
     3        * Add cookieAttributes to SessionService to make it easier 
     4          to customize the generated cookie's attributes. 
     5 
    162006-08-28  Allan Saddi  <asaddi@sahara.flup.org> 
    27 
  • flup/middleware/session.py

    r40 r42  
    539539      service.encodeURL(url) - Returns url encoded with Session ID (if 
    540540        necessary). 
     541      service.cookieAttributes - Dictionary of additional RFC2109 attributes 
     542        to be added to the generated cookie. 
    541543    """ 
    542544    _expiredSessionIdentifier = 'expired session' 
     
    544546    def __init__(self, store, environ, 
    545547                 cookieName='_SID_', 
    546                  cookieExpiration=None, 
     548                 cookieExpiration=None, # Deprecated 
     549                 cookieAttributes={}, 
    547550                 fieldName='_SID_'): 
    548551        self._store = store 
    549552        self._cookieName = cookieName 
    550553        self._cookieExpiration = cookieExpiration 
     554        self.cookieAttributes = dict(cookieAttributes) 
    551555        self._fieldName = fieldName 
    552556 
     
    626630            if self._cookieExpiration is not None: 
    627631                C[name]['expires'] = self._cookieExpiration 
     632            C[name].update(self.cookieAttributes) 
    628633            if expireCookie: 
    629634                # Expire cookie