You are not logged in.
Hi all,
I found that there will be a field called "id" returned ( 786998398 in the following json sample) in json if using sicPerSession in calling interface interface based service.
As I want to keep track of user behavior, Can I retrieve session id like "id" within calling interface based service such as in the area of
ServiceContext.Request.Call.InHead?
Thanks for your advice.
Regards,
Kenneth
JSON example
e.g
{
"result" : {
"success" : true,
"msg" : "",
"data" : []
},
"id" : 786998398
}
Last edited by hkcity1111 (2015-05-24 16:24:43)
Offline
See in the ServiceContext treadvar itself: it has a ServiceContext.Request field which has anything you need.
For instance, the Session property, but others:
/// the corresponding session TAuthSession.IDCardinal value
// - equals 0 (CONST_AUTHENTICATION_SESSION_NOT_STARTED) if the session
// is not started yet - i.e. if still in handshaking phase
// - equals 1 (CONST_AUTHENTICATION_NOT_USED) if authentication mode
// is not enabled - i.e. if TSQLRestServer.HandleAuthentication = FALSE
Session: cardinal;
/// the corresponding TAuthSession.User.GroupRights.ID value
// - is undefined if Session is 0 or 1 (no authentication running)
SessionGroup: integer;
/// the corresponding TAuthSession.User.ID value
// - is undefined if Session is 0 or 1 (no authentication running)
SessionUser: TID;
/// the corresponding TAuthSession.User.LogonName value
// - is undefined if Session is 0 or 1 (no authentication running)
SessionUserName: RawUTF8;
/// the remote IP from which the TAuthSession was created, if any
// - is undefined if Session is 0 or 1 (no authentication running)
SessionRemoteIP: RawUTF8;
Offline
Thanks for your prompt reply.
It is very helpful.
Offline