code: def get_and_save_value(self, name, default=None):
          
          if getattr(self, name, None):
              return getattr(self, name)
  
          value = self.get_session_value(name, default)
          value = self.request.POST.get(name, value)
          self.save_value(name, value)
          return value
docs: Get value from request/session and save value to session