BotContext - Does it get cleared with end of user session?


(Neha Sheikh) #1

I have added some data to my botcontext.
Will it get removed/cleared from bot if any of bot user session expires?


(swathi vadlamani) #2

@nehamsheikh Data saved in bot doesn’t get deleted, even post user session expires.


(Subrahmanyam Donepudi) #3

Hi @nehamsheikh

The TTL for variables being created under any of the context types can be defined using the below syntax:

BotContext.put("", “Value”, TTL)

*TTL (time to last in mins)

Please refer to the below link for more details:

If the TTL is not specified while creating variables, they last forever under the respective context types except for UserSession and BotUserSession. For these two context types, if the TTL is not provided for variables, the default time to last is 30 mins.