question

Kim Strasser avatar image
Kim Strasser asked

Extending the SessionTicket expiration date

I found out that EntityToken.TokenExpiration changes if the client logs in with PlayFabClientAPI.LoginWithIOSDeviceID.

Does this mean that every time the client logs in his TokenExpiration gets extended? Does it only get extended when the client logs in or does it also get extended with all other client, server or admin PlayFab API calls?

Is the value of EntityToken.TokenExpiration always the SessionTickets expiration date? I want to know if a client can use the same SessionTicket all the time if he plays my game frequently(less than 24 hours between two log ins).

In addition, you can see in my pictures that SessionTicket has another string in the second picture than in the first picture. Why is the string not exactly the same in the two pictures?

First login:

{
    "EventName": "entity_logged_in",
    "Source": "PlayFab",
    "EntityChain": "title_player_account!4CE2E85814BA15CA/BFD0A/C30AD4505A3C3388/1A3CDE1001E2697/",
    "EntityId": "1A3CDE1001E2697",
    "EntityLineage": {
        "NamespaceId": "4CE2E85814BA15CA",
        "TitleId": "BFD0A",
        "MasterPlayerAccountId": "C30AD4505A3C3388",
        "TitlePlayerAccountId": "1A3CDE1001E2697",
        "CharacterId": null,
        "GroupId": null,
        "CloudRootId": null
    },
    "EventNamespace": "com.playfab",
    "EventId": "cd2119dc82ff409186cd69f8c3e31683",
    "EntityType": "title_player_account",
    "SourceType": "BackEnd",
    "Timestamp": "2019-12-26T09:48:37.9593766Z",
    "History": null,
    "CustomTags": null,
    "Reserved": null,
    "PlayFabEnvironment": {
        "Vertical": "master",
        "Cloud": "main",
        "Application": "mainserver",
        "Commit": "14dbbed"
    }
}

Second login:

{
    "EventName": "entity_logged_in",
    "Source": "PlayFab",
    "EntityChain": "title_player_account!4CE2E85814BA15CA/BFD0A/C30AD4505A3C3388/1A3CDE1001E2697/",
    "EntityId": "1A3CDE1001E2697",
    "EntityLineage": {
        "NamespaceId": "4CE2E85814BA15CA",
        "TitleId": "BFD0A",
        "MasterPlayerAccountId": "C30AD4505A3C3388",
        "TitlePlayerAccountId": "1A3CDE1001E2697",
        "CharacterId": null,
        "GroupId": null,
        "CloudRootId": null
    },
    "EventNamespace": "com.playfab",
    "EventId": "78b9089b35784b26b9336d3d2f08ec51",
    "EntityType": "title_player_account",
    "SourceType": "BackEnd",
    "Timestamp": "2019-12-26T10:13:38.1461957Z",
    "History": null,
    "CustomTags": null,
    "Reserved": null,
    "PlayFabEnvironment": {
        "Vertical": "master",
        "Cloud": "main",
        "Application": "mainserver",
        "Commit": "14dbbed"
    }
}
Account Management
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

>>Does this mean that every time the client logs in his TokenExpiration gets extended?

No, to be clear, its TokenExpiration didn't actually extend. In your case, if you take a closer look at the EntityToken in the second login’s response you will find that it’s not the same as the one in the first login. So, what the login call does is: returning a new EntityToken with a refreshed TokenExpiration rather than extending the previous one’s.

>>Is the value of EntityToken.TokenExpiration always the SessionTickets expiration date? I want to know if a client can use the same SessionTicket all the time if he plays my game frequently(less than 24 hours between two log ins).

In your case, calling login APIs, it’s OK for you to consider the EntityToken.TokenExpiration as the SessionTickets expiration date because login calls return a new EntityToken with a refreshed TokenExpiration and a new SessionTicket that both last 24 hours. However, it’s important for you to understand that SessionTicket and TokenExpiration are two separate things, there is no certain connection between them.

That being said, a client can use the same SessionTicket within 24 hours no matter he/she plays your game frequently or not.

>>Why is the string not exactly the same in the two pictures?

Like I mentioned above, the second login call will return a new SessionTicket, which is different from the one in the first login call. In other words, SessionTicket is not a renewable token, any Login APIs will return a new one instead of extending old ones’ expiration date.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.