def get_current_user(self):
     if self.user is None:
         session = Session.get_from_cookie(self)
         if session is not None:
             session.save()
             self.user = User.find(session.user_model_id)
     return self.user
 def do_logout(self):
     if self.current_user is not None:
         session = Session.get_from_cookie(self)
         session.clear_cookie(self)
         session.delete()