Skip to main content

NIM

Session Variables

In NIM, session variables play a crucial role in maintaining state and user-specific information across different interactions. These session variables can be configured using filters and the built-in session variable functionalities within NIM. Filters allow for dynamic data manipulation and conditional logic to be applied when setting or updating session variables. For instance, a filter can be used to check if a certain condition is met before assigning a value to a session variable, ensuring that the state management is both flexible and context-sensitive. Built-in session variables provide a standardized way to handle common user attributes, such as session identifiers, user roles, and authentication tokens, streamlining the process of state management across various modules of the NIM environment.

In the following example, we demonstrate how to utilize the "sessionUserName" to retrieve a user's Active Directory (AD) email address and store it in a session variable named "sessionADmail". First, a filter can be set up to trigger when the "sessionUserName" variable is populated, typically during user login or authentication processes. This filter will call an AD lookup service, passing the "sessionUserName" as a parameter. Upon receiving the response from the AD service, which includes the user's email address, the filter will then assign this email address to the "sessionADmail" session variable. This approach ensures that the email address is readily available for use in subsequent interactions within the NIM environment, enabling personalized and efficient user experiences. By leveraging the power of filters and built-in session variables, NIM provides a robust framework for dynamic and context-aware state management.

  1. Create a new filter called Session_AD_User_View

  2. Your start table will be AD.Users

  3. Create a parameter called currentUsername, leveraging the existing session variable sessionUserName

  4. Add an expression to the table that leverages your new parameter, validating it against the sAMAccountName. The finall result should look like the following

    NIM_Configuration_Variables_Session01.png
  5. Under Configuration > Variables > Session Tab, add a new entry with the following properties

    1. Name: sessionADmail

    2. Filter: Session_AD_User_View

    3. Filter Column: mail

    4. Required: false

    5. Data Type: string

    6. Description: Current AD User mail address

      NIM_Configuration_Variables_Session02.png