I have a Pyramid application using Beaker Encrypted cookie sessions. I can log a user in using a RequestWithUserAttribute, pyramid.security.authenticated_userid(), remember() and forget() just fine.
However, the majority of users will never log in, and there is a specific value I'd like to save in a cookie (encrypted if at all possible) that the user has given then site (their location, or any string for that matter).
I cannot discover how to set more than the principal for a session using the remember() function, and I'd prefer not to send my own Set-Cookie headers, let alone deal with the encryption of the data myself.
I have found that you can pass keyword arguments to remember():
remember(request, principal, *kw)
But when I try to send any extra values I continuously run into an error.
Ideally I would expect something like this:
remember(request, 'public', {'location':request.params.get('location')})
Is this even the correct route?