encrypted cookies

21 views
Skip to first unread message

León Domingo

unread,
Apr 24, 2012, 3:01:32 AM4/24/12
to turbo...@googlegroups.com
Hi,
I'm using this to store a value into a cookie:

   response.set_cookie('foo', value=bar, max_age=1234567)

Is there any way to encrypt the value? Should I use Beaker instead of WebOb (response)? In that case, could you give me an example?

Thanks in advance

León

Alessandro Molina

unread,
Apr 24, 2012, 7:08:58 PM4/24/12
to turbo...@googlegroups.com
Easiest way is to store the values inside tg.session and set session
as being stored as a crypted cookie by placing:

beaker.session.type = cookie
beaker.session.validate_key = abcde1234longprivatekey

inside your development.ini

> --
> You received this message because you are subscribed to the Google Groups
> "TurboGears" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/turbogears/-/jWuYthdlaycJ.
> To post to this group, send email to turbo...@googlegroups.com.
> To unsubscribe from this group, send email to
> turbogears+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/turbogears?hl=en.

Reply all
Reply to author
Forward
0 new messages