At end of active session of user I wants to remove all sessionAttributes using handlerInput.attributesManager
.
How to remove all sessions at end of AMAZOn.StopIntent
At end of active session of user I wants to remove all sessionAttributes using handlerInput.attributesManager
.
How to remove all sessions at end of AMAZOn.StopIntent
Alexa ends it's active session when there is no input from the user even after reprompt, or the response itself has a
shouldEndSession
set totrue
, or there is an error in the response. In all these cases thesessionAttributes
are all cleared. So you don't have to explicitly clear it.The user has open the skill again to interact with the skill and that will be a new user session with no
sessionAttributes
itself.Now if you want to end the session which in turn clears the sessionAttributes you do:
In ask-nodejs-sdk v2, don't specify a reprompt, this will set
shouldEndSession
set totrue
automatically.In ask-nodejs-sdk v1, use
:tell
, this will setshouldEndSession
set totrue
automatically.