Skip to content

Commit

Permalink
fix setting the auth-cookie in py3
Browse files Browse the repository at this point in the history
  • Loading branch information
pbauer authored and jensens committed Sep 14, 2018
1 parent 08a3671 commit 94f53bf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Products/PlonePAS/plugins/cookie_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ def updateCredentials(self, request, response, login, new_password):

setAuthCookie = getattr(self, 'setAuthCookie', None)
if setAuthCookie:
cookie_val = encodestring('%s:%s' % (login, new_password))
cookie_str = b':'.join([
login.encode('utf-8'),
new_password.encode('utf-8'),
])
cookie_val = encodestring(cookie_str)
cookie_val = cookie_val.rstrip()
setAuthCookie(response, self.cookie_name, quote(cookie_val))
else:
Expand Down

0 comments on commit 94f53bf

Please sign in to comment.