Before writing a CREATE SESSION POLICY statement:
- Read
references/parameters.mdto review all available parameters and their defaults. - For each parameter, decide whether the user's request implies a non-default value.
- Include only the parameters that differ from the default or that the user explicitly requested.
- Never use
CREATE OR REPLACE— always useCREATE SESSION POLICY IF NOT EXISTS. - SESSION_IDLE_TIMEOUT_MINS applies to all Snowflake clients and programmatic connections; SESSION_UI_IDLE_TIMEOUT_MINS applies only to Snowsight. Set both when the user needs consistent behavior across interfaces.
- BLOCKED_SECONDARY_ROLES takes precedence over ALLOWED_SECONDARY_ROLES; avoid specifying the same role in both lists.
- Remind the user that the policy must be attached to a user or account with
ALTER USER SET SESSION_POLICYorALTER ACCOUNT SET SESSION_POLICYto take effect.