Changeset 51:eca383e1401c

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

Add forceCookieOutput attribute to SessionService? to
force Set-Cookie output for the current request.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ChangeLog

    r50 r51  
     12006-12-02  Allan Saddi  <asaddi@sahara.flup.org> 
     2 
     3        * Add forceCookieOutput attribute to SessionService to 
     4          force Set-Cookie output for the current request. 
     5 
    162006-12-01  Allan Saddi  <asaddi@europa.saddi.net> 
    27 
  • flup/middleware/session.py

    r42 r51  
    541541      service.cookieAttributes - Dictionary of additional RFC2109 attributes 
    542542        to be added to the generated cookie. 
     543      service.forceCookieOutput - Normally False. Set to True to force 
     544        output of the Set-Cookie header during this request. 
    543545    """ 
    544546    _expiredSessionIdentifier = 'expired session' 
     
    553555        self._cookieExpiration = cookieExpiration 
    554556        self.cookieAttributes = dict(cookieAttributes) 
     557        self.forceCookieOutput = False 
    555558        self._fieldName = fieldName 
    556559 
     
    616619    def addCookie(self, headers): 
    617620        """Adds Set-Cookie header if needed.""" 
    618         if not self.encodesSessionInURL and self._shouldAddCookie(): 
     621        if not self.encodesSessionInURL and \ 
     622               (self._shouldAddCookie() or self.forceCookieOutput): 
    619623            if self._session is not None: 
    620624                sessId = self._sessionIdentifier()