On Tue, Feb 17, 2009 at 2:16 PM, anders conbere <[email protected]> wrote: > > I've been struggling with this for a while (I have irc logs that date > back to almost a year ago talking about this), but I still have been > unable to grok how to setup sessions or secure cookie or whatever. And > I've come to think that perhaps there's something I'm just not > groking. I was hoping to get some use examples of one of the various > methods of acomplishing this task. > > As for SecureCookie. It has great implementation documentation, but > has nothing on how to use it in views > > I know that it provides a chached_property of client_session on the > request object, but there's no examples of use in views... do you just > assign to the cached property? > >>>> request.client_session['some_value'] = True >
Hi Anders, I've never used secure cookies in werkzeug application, but I think what you've described is all you need to do. Why not just experiment to see if it works? No puppies will be killed if you try and fail. There is a very minimal example here: http://dev.pocoo.org/projects/werkzeug/browser/examples/contrib/securecookie.py get_time and set_time in the above example are just views. > Beyond the secure cookies with also have the sessions code in > contrib/sessions.py > > which starts off by showing me how to implement a middleware solution, > and then telling me not to do that. And then again provides no > examples of use in views. > > Maybe I'm just impaired here, but I have no idea how to use any of these > things. I think the answer is just to extend Request and attach session object in __init__ as in the above example. Hope that helps. -Drew --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pocoo-libs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pocoo-libs?hl=en -~----------~----~----~----~------~----~------~--~---
