diff options
| author | cce <devnull@localhost> | 2006-01-03 00:16:20 +0000 |
|---|---|---|
| committer | cce <devnull@localhost> | 2006-01-03 00:16:20 +0000 |
| commit | 2c28d9f6ea7c0f0d9f135dccec31c2d987495a06 (patch) | |
| tree | 21f535bd9704a4095b335264546df1afa54dbb2c /paste/auth/cookie.py | |
| parent | 74b7bfa4b897dfd5a4ab5271cc719538b8084c56 (diff) | |
| download | paste-2c28d9f6ea7c0f0d9f135dccec31c2d987495a06.tar.gz | |
- made the example program simpler for paste.auth.cookie, no
point in adding in so many features when trying to introduce
a new person to this module
Diffstat (limited to 'paste/auth/cookie.py')
| -rw-r--r-- | paste/auth/cookie.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/paste/auth/cookie.py b/paste/auth/cookie.py index a985f11..f06dcc9 100644 --- a/paste/auth/cookie.py +++ b/paste/auth/cookie.py @@ -14,9 +14,7 @@ server-side expiration. Following is a very simple example where a form is presented asking for a user name (no actual checking), and dummy session identifier (perhaps -corresponding to a database session id) is stored in the cookie. It -also demonstrates the extension mechanism for storing other environment -variables, if needed. +corresponding to a database session id) is stored in the cookie. >>> from paste.util.httpserver import serve >>> from paste.fileapp import DataApp @@ -28,12 +26,9 @@ variables, if needed. ... if user: ... environ['REMOTE_USER'] = user ... environ['REMOTE_SESSION'] = 'a-session-id' -... environ['EXTRA_STUFF'] = '1234' # save this too -... environ['paste.auth.cookie'].append('EXTRA_STUFF') ... if environ.get('REMOTE_USER'): -... page = '<html><body>Welcome %s (%s) [%s]</body></html>' -... page %= (environ['REMOTE_USER'], environ['REMOTE_SESSION'], -... environ['EXTRA_STUFF']) +... page = '<html><body>Welcome %s (%s)</body></html>' +... page %= (environ['REMOTE_USER'], environ['REMOTE_SESSION']) ... else: ... page = ('<html><body><form><input name="user" />' ... '<input type="submit" /></form></body></html>') |
