show error when 'when' option is invalid
cache session when login