Good morning,
We are building a module for a client to run in an instance of that depends deeply on how the user is logged (email / rrss) and if it is first login / etc...
also the session expiration time (if it is still valid) and if it needs to reinitialise the session
and we need to do, as much as possible on client side with JS (instance works mostly as SPA, and has a WebApp)
Looking in client side, we see as available resources for our purpose:
Login Cookie, where is set the expiration time (SESSION in case of RRSS)
HTML values of <input name="__dnnVariable" ...>
dnn.js with dnn.getVar("dnn_current_userid")
the thing is:
the cookie is set to HTTPonly, so not access from JS
can this cookie be set, so, it is accesible from JS ??, is there any configuration for that?
HTML values, not always consisten, sometimes loads with " and sometimes with `
is this inconsistency a bug?, or does it have some reasoning?
(when value is using ` the value is indeed not a valid JSON, but the dnn.js has a built function that makes:
a.value = a.value.substring(1).replace(/`/g, '"') )
dnn.js is actually not being loaded on client instance, client not sure why, but in his instance seems unnecesary
is there a documentation for this file? / is that supposed to be used by module developers or is it an internal thing of DNN?
should be possible, as it is the case, for this file to be optional ?
UserName
is there a CLIENT-SIDE function or feature that respond with the UserName and other user properties ?
of course we can build our own CS server side code, but we would like to be aligned as much as possible with DNN best practices.
are we in the right track ?