Changeset 42:b66e245d5b19
- 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
| r41 |
r42 |
|
| | 1 | 2006-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 | |
|---|
| 1 | 6 | 2006-08-28 Allan Saddi <asaddi@sahara.flup.org> |
|---|
| 2 | 7 | |
|---|
| r40 |
r42 |
|
| 539 | 539 | service.encodeURL(url) - Returns url encoded with Session ID (if |
|---|
| 540 | 540 | necessary). |
|---|
| | 541 | service.cookieAttributes - Dictionary of additional RFC2109 attributes |
|---|
| | 542 | to be added to the generated cookie. |
|---|
| 541 | 543 | """ |
|---|
| 542 | 544 | _expiredSessionIdentifier = 'expired session' |
|---|
| … | … | |
| 544 | 546 | def __init__(self, store, environ, |
|---|
| 545 | 547 | cookieName='_SID_', |
|---|
| 546 | | cookieExpiration=None, |
|---|
| | 548 | cookieExpiration=None, # Deprecated |
|---|
| | 549 | cookieAttributes={}, |
|---|
| 547 | 550 | fieldName='_SID_'): |
|---|
| 548 | 551 | self._store = store |
|---|
| 549 | 552 | self._cookieName = cookieName |
|---|
| 550 | 553 | self._cookieExpiration = cookieExpiration |
|---|
| | 554 | self.cookieAttributes = dict(cookieAttributes) |
|---|
| 551 | 555 | self._fieldName = fieldName |
|---|
| 552 | 556 | |
|---|
| … | … | |
| 626 | 630 | if self._cookieExpiration is not None: |
|---|
| 627 | 631 | C[name]['expires'] = self._cookieExpiration |
|---|
| | 632 | C[name].update(self.cookieAttributes) |
|---|
| 628 | 633 | if expireCookie: |
|---|
| 629 | 634 | # Expire cookie |
|---|