Saving, Retrieving, and Deleting Session Variables
Session variables are the set of variables that are active for a particular session. For example, if a device is detected on a universal port and this triggers a profile (and the script commands within it), the variable values that were active when the profile started are replaced with the variable values defined in the profile. The first session is the device-undetected session, and the second session is the device-detected session. Each session has its own set of variables and values.
The software allows you to save session variables before replacing them. In the example above, this allows you to retrieve the earlier values when the port returns to the device-undetected state. Up to five variables can be saved or retrieved at a time. These variables are saved to system memory using a key, which is an ID for the saved variables. You are responsible for generating unique keys. When you want to retrieve the variables, you use the key to identify the variables to be retrieved.
To save up to five session variables, use the following
save var key key [var1 var2 …]
- To retrieve saved session variables, use the following
command:load var key key [var1 var2 …]
- To delete saved session variables, use the following
command:sdelete var key key
The variables saved by the save var command are saved using the specified key and are retrievable and restored in the context that this profile was applied. They are available to rollback events like user-unauthenticate and device-undetect.
NoteFor SummitStack, session variables are saved on the master ExtremeSwitching switch. To repopulate session variables after a failover event, manually execute the appropriate script.