ADC

Session policies

After you create one or more session profiles, you create session policies and then bind the policies globally or to an authentication virtual server to put them into effect.

To create a session policy by using the command line interface

At the command prompt, type the following commands to create a session policy and verify the configuration:

-  add tm sessionPolicy <name> <rule> <action>
-  show tm sessionPolicy <name>
<!--NeedCopy-->

Example

> add tm sessionPolicy session-pol "URL == /*.gif" session-profile
Done
> show tm sessionPolicy session-pol
1)      Name: session-pol       Rule: URL == '/*.gif'
        Action: session-profile
 Done
<!--NeedCopy-->

To modify a session policy by using the command line interface

At the command prompt, type the following commands to modify a session policy and verify the configuration:

-  set tm sessionPolicy <name> [-rule <expression>] [-action <action>]
-  show tm sessionPolicy <name>
<!--NeedCopy-->

Example

> set tm sessionPolicy session-pol "URL == /*.gif" session-profile
 Done
> show tm sessionPolicy session-pol
1)      Name: session-pol       Rule: URL == '/*.gif'
        Action: session-profile
 Done
<!--NeedCopy-->

To globally bind a session policy by using the command line interface

At the command prompt, type the following commands to globally bind a session policy and verify the configuration:

```bind tm global -policyName [-priority ]


Example

bind tm global -policyName session-pol Done

show tm sessionPolicy session-pol 1) Name: session-pol Rule: URL == ‘/*.gif’ Action: session-profile Policy is bound to following entities 1) TM GLOBAL PRIORITY : 0 Done


## To bind a session policy to an authentication virtual server by using the command line interface

At the command prompt, type the following command to bind a session policy to an authentication virtual and verify the configuration:

```bind authentication vserver <name> -policy <policyname> [-priority <priority>]<!--NeedCopy-->

Example

> bind authentication vserver auth-vserver-1 -policyName Session-Pol-1 -priority 1000
Done
<!--NeedCopy-->

To unbind a session policy from an authentication virtual server by using the command line interface

At the command prompt, type the following commands to unbind a session policy from an authentication virtual server and verify the configuration:

```unbind authentication vserver -policy


Example

unbind authentication vserver auth-vserver-1 -policyName Session-Pol-1 Done


## To unbind a globally bound session policy by using the command line interface

At the command prompt, type the following commands to unbind a globally-bound session policy:

```unbind tm global -policyName <policyname><!--NeedCopy-->

Example

> unbind tm global -policyName Session-Pol-1
Done
<!--NeedCopy-->

To remove a session policy by using the command line interface

First unbind the session policy from global, and then, at the command prompt, type the following commands to remove a session policy and verify the configuration:

```rm tm sessionPolicy


Example

rm tm sessionPolicy Session-Pol-1 Done

```

To configure and bind session policies by using the configuration utility

  1. Navigate to Security > AAA - Application Traffic > Session.
  2. Navigate to Security > AAA - Application Traffic > Policies > Session.
  3. In the details pane, on the Policies tab, do one of the following:
    • To create a new session policy, click Add.
    • To modify an existing session policy, select the policy, and then click Edit.
  4. In the Create Session Policy or Configure Session Policy dialog, type or select values for the parameters.
    • Name*—policyname (Cannot be changed for a previously configured session policy.)
    • Request Profile*—actionname
    • Expression*—rule (You enter expressions by first choosing the type of expression in the leftmost drop-down list beneath the Expression text area and then typing your expression directly into the expression text area, or by clicking Add to open the Add Expression dialog box and using the drop-down lists in it to construct your expression.)
  5. Click Create or OK. The policy that you created appears in the details pane of the Session Policies and Profiles page.
  6. To globally bind a session policy, in the details pane, select Global Bindings from the Action drop-down list, and fill in the dialog.
    • Select the name of the session policy you want to globally bind.
    • Click OK.
  7. To bind a session policy to an authentication virtual server, in the navigation pane, click Virtual Servers, and add that policy to the policies list.
    • In the details pane, select the virtual server, and then click Edit.
    • In the Advanced Selections to the right of the detail area, click Policies.
    • Select a policy, or click the plus icon to add a policy.
    • In the Priority column to the left, modify the default priority as needed to ensure that the policy is evaluated in the proper order.
    • Click OK. A message appears in the status bar, stating that the policy has been configured successfully.