question

hoangtrunghuster avatar image
hoangtrunghuster asked

How to get session ticket in cloudscript?

In your answer, I want to get session ticket for making session ticket expire. https://community.playfab.com/questions/38146/how-can-i-make-a-session-ticket-expire.html

CloudScript
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

·
Xiao Zha avatar image
Xiao Zha answered

Since in the post you mention, you comment “How to get session ticket in cloudscript?” and” How to store the session ticket into Player Read-Only Data in cloudscript?”, you can use Server API UpdateUserReadOnlyData to store the session ticket and use GetUserReadOnlyData to get the session ticket.

3 comments
10 |1200

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

hoangtrunghuster avatar image hoangtrunghuster commented ·

Hi Xiao Zha,

I hear you, but when the player is logged in, i set the automation's rule player_logged_in to handle in cloudscript. I want to get the user's session ticket in there. So how to get it?

0 Likes 0 ·
Xiao Zha avatar image Xiao Zha hoangtrunghuster commented ·

Since the player_logged_in event does not contain a session ticket, you cannot use the context parameter in CouldScript to get the session ticket. If you want to store the session ticket in UserReadOnlyData after player logged in, you need to call the ExecuteCouldScript API on the client, then use FunctionParameter property to pass the session ticket to your CouldScript, and then you can get the session ticket through the args parameter in CouldScript. For more information on using CouldScript, you can refer to Writing custom CloudScript (Legacy) - PlayFab | Microsoft Learn.

1 Like 1 ·
hoangtrunghuster avatar image hoangtrunghuster Xiao Zha commented ·

thank you for your support

0 Likes 0 ·

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.