cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Setting and retrieving User Session Property values via JS API?

jeff_rowell
Helper

I have a requirement to pass the numeric ID returned from the DTRUM.enterAction method that is being called in a logon web page provided by one of our
authentication systems to a web page of another system. Since there is no way
for us to pass the value via a cookie, JS variable etc. without making
extensive system changes, I am hoping that use can be made of the new User
Session Properties features of version 164. Whether this is going to be possible,
however, isn’t clear to me from the documentation.

I can
see that DTRUM provides a sendSessionProperties
method that, I suspect, could be used to add the numeric ID to the user
session (?), but I am not clear whether Dynatrace provides any mechanism that would
allow the JS in our destination web page to retrieve the value. Looking at the
DTRUM documentation I don’t see any such capability. Can anyone clarify whether
we can achieve what we want using a User Session variable? What I had hoped to
do is illustrated by the following:

// Step 1 – In web page of the user authentication
system call dtrum.enterAction to start a custom user action

LogonTimerAction = dtrum.enterAction('Logon Time', 'LogonTimer',
null, 'info');

//
Step 2 – In web page of the user authentication, put the return value of the
above API call into a User Session Property via the sendSessionProperties
API (?)

//
Step 3 – In the destination systems web page, retrieve the variable from the
user session attribute.

//
Step 4 – In the destination systems web page, pass the variable to
dtrum.leaveAction to close the action and obtain its timing.

dtrum.leaveAction(LogonTimerAction);

More generally,
can you tell me where I can find detailed documentation for the Session
properties configuration options? I see “JavaScript API” as an “Expression type”
that can be selected, but I am unable to find any documentation of what this
represents or how to configure it. Similarly, I understand that we can set session
properties using request attributes, but I cannot find documentation of how to
configure a session attribute using a request attribute.

 

1 REPLY 1

Julius_Loman
DynaMight Guru
DynaMight Guru

As far as I know, there is no option to retrieve any user session property values from the dtrum js api. User session properties can be only set in dtrum. The architecture of beacons is "send only". Session data are processed on the server.

I'm afraid you will have to find another solution using cookie seems to be a straightforward idea.

Values of user session properties can be only used within session analysis (you can filter on them or display them). Also, they can be used in USQL queries as well.

More on this topic in this blog post.


TEMPEST a.s., Slovakia, Dynatrace Master Partner