[Zope-CVS] CVS: Products/PluggableAuthService/plugins - CookieAuthHelper.py:1.12

Chris McDonough chrism at plope.com
Sun Nov 28 20:23:56 EST 2004


Update of /cvs-repository/Products/PluggableAuthService/plugins
In directory cvs.zope.org:/tmp/cvs-serv20287

Modified Files:
	CookieAuthHelper.py 
Log Message:
Make encoding and decoding strategies match those of Cookie Crumbler.


=== Products/PluggableAuthService/plugins/CookieAuthHelper.py 1.11 => 1.12 ===
--- Products/PluggableAuthService/plugins/CookieAuthHelper.py:1.11	Tue Nov 23 04:31:36 2004
+++ Products/PluggableAuthService/plugins/CookieAuthHelper.py	Sun Nov 28 20:23:55 2004
@@ -18,7 +18,7 @@
 """
 
 from base64 import encodestring, decodestring
-from urllib import quote
+from urllib import quote, unquote
 
 from AccessControl.SecurityInfo import ClassSecurityInfo
 from OFS.Folder import Folder
@@ -103,7 +103,7 @@
         cookie = request.get(self.cookie_name, '')
 
         if cookie:
-            cookie_val = decodestring(cookie)
+            cookie_val = decodestring(unquote(cookie))
             login, password = cookie_val.split(':')
 
             creds['login'] = login
@@ -138,8 +138,8 @@
     def updateCredentials(self, request, response, login, new_password):
         """ Respond to change of credentials (NOOP for basic auth). """
         cookie_val = encodestring('%s:%s' % (login, new_password))
-        cookie_val = cookie_val.replace( '\n', '' )
-        response.setCookie(self.cookie_name, cookie_val, path='/')
+        cookie_val = cookie_val.rstrip()
+        response.setCookie(self.cookie_name, quote(cookie_val), path='/')
 
 
     security.declarePrivate('resetCredentials')



More information about the Zope-CVS mailing list