Forum Discussion

Jonathanfabrin's avatar
Jonathanfabrin
Icon for Nimbostratus rankNimbostratus
Sep 10, 2024

APM subsession variables disappear before session is terminated

Hi We are currently trying to access APM subsession variables in a Per-Request policy. The subsession variables contains user information gathered when validating users with a OAuth client "branch"...
  • Lucas_Thompson's avatar
    Sep 10, 2024

    Cool use of subsessions! There's a lot of power here, but parts of it are hard to understand. And hard to explain!

    The subsession object has some properties:

     

    The "max subsession life" essentially says how long the variables will last in the sessiondb. You may set this value up to 604800, so that the subsession can last 1 week. Keep in mind that the subsession relies on the main session, so it also must stay alive in order to hold the data.

    If you haven't yet discovered the "sessiondump" CLI command, it's very helpful when working with subsessions.

    Also I'm fairly sure you can use iRules to copy subsession vars into session vars when executing them (via iRule agent) inside of the subession. When you use the set-variable agent in a subsession, it will only save subsession variables (as you've found). This is more of a convenience thing than a limitation.