How to save and retrieve a cookie by tipfy

62 views Asked by At

Hi i want to store an object as a secure cookie in tipfy and want to retrieve the object from the tipfy. How to do this?

this is what i have done so for . this code segment is inside a handler extends from Request handler

  class UserLogin(RequestHandler, Jinja2Mixin):
        do_post(self):
          user_cookie = Cookie.SimpleCookie()
          user_cookie['current_user'] = pickle.dumps(profile_user)
          user_cookie['current_user']['max-age'] = 60 * 60 * 24 * 365
          logging.info(user_cookie['current_user'])

i do not know a way to save the cookie mentioned in the documentation werkzeug.contrib.securecookie.SecureCookie.save_cookie:

0

There are 0 answers