Sign In Register

How can we help you today?

Start a new topic
Answered

Count how many times a user started session by authTokens

Hello,


If a user has 10 authTokens, does it mean this user had started 10 sessions?


Thanks!


Irakli


Best Answer

Hi Irakli,


Generally yes, an auth-token is generated on Successful Authentication and stored against the player document. However, auth-tokens can be retired, so relying on the amount of auth-tokens on the player document to determine how many sessions they have started would not be advised. If you would like to accomplish this another way, might I suggest storing a "playerSessions" attribute on the players privateData, a number that you would increment by 1 in the "Player Connected" or "AuthenticationResponse" Cloud Code scripts.


-Pádraig

1 Comment

Answer

Hi Irakli,


Generally yes, an auth-token is generated on Successful Authentication and stored against the player document. However, auth-tokens can be retired, so relying on the amount of auth-tokens on the player document to determine how many sessions they have started would not be advised. If you would like to accomplish this another way, might I suggest storing a "playerSessions" attribute on the players privateData, a number that you would increment by 1 in the "Player Connected" or "AuthenticationResponse" Cloud Code scripts.


-Pádraig

Login to post a comment