Session variable migration tasks

These are migration tasks for session variables:

  • Create a list of session variables used by custom code, and then, one session variable at a time, determine which layouts have scripting that reference the session variable. For session variables that are referenced in both the client and server scripts, make the appropriate change as determined here:
    • Ideal solution: Use ClientSessionVariables or ServerSessionVariables, but not ClientServerSessionVariables. One way to accomplish this is to make use of layout variables. Define a ClientServerLayoutVariable and set it to the value of the ServerSessionVariable. Then in the client script, use the ClientServerLayoutVariable instead of the ClientSessionVariable. Or you could move the client-side logic that references the ClientSessionVariable to the server side, and trigger the server-side script to execute by using either the AlertSelf or AlertSelfFilterChanged APIs. When using AlertSelf, move the logic to the server-side OnAlert handler. When using AlertSelfFilterChanged, move the logic to the OnFilterChanged handler.
    • Alternative solution: Use ClientServerSessionVariables, but allow the server to only write it, never read it. Verify whether the session variable is safe to access from both the client and server. If so, use the (Get)ClientServerSessionVariables API in both client and server scripting. The session variable is safe if it is not used for UI interactions or for performing database updates. If it is not safe, move the session variable to the server scripting. If you cannot move the code, use the (Get)ClientServerSessionVariables API in both client and server scripting.
  • The filtering attributes in a field display format (FDF) may also reference ClientServerSessionVariables. The migration may convert SessionVariables to ClientServerSessionVariables depending on the configuration. ClientServerSessionVariables should all be changed to ServerSessionVariables.

    Create a list of FDFs that reference ClientServerSessionVariables, and then, one FDF at a time, determine whether it should reference a ServerSessionVariable instead.

To acquire a list of session variable names that need to be evaluated, search for all layouts that contain SessionVariable. Also, to get a list of FDFs that must be evaluated, search all FDFs that reference ClientServerSessionVariable.

Note: We suggest using a ClientServerSessionVariable naming standard, such as to append_CSSV to each variable name.