def bandit_sticky_choose(exp)
      name = "bandit_#{exp}".intern
      # choose url param with preference
      value = params[name].nil? ? cookies.signed[name] : params[name]
      # sticky choice may outlast a given alternative
      alternative = if Bandit.get_experiment(exp).alternatives.include?(value)
                      value
                    else
                      Bandit.get_experiment(exp).choose(value)
                    end
      # re-set cookie
      cookies.permanent.signed[name] = alternative
    end
def bandit_sticky_choose(exp)
      name = "bandit_#{exp}".intern
      # choose url param with preference
      value = params[name].nil? ? cookies.signed[name] : params[name]
      # sticky choice may outlast a given alternative
      alternative = if Bandit.get_experiment(exp).alternatives.include?(value)
                      value
                    else
                      Bandit.get_experiment(exp).choose(value)
                    end
      # re-set cookie
      cookies.permanent.signed[name] = alternative
    end
stick to one alternative until user deletes cookies or changes browser