Now that we have created a table in DynamoDB, all session attributes will automatically be written to the database when you call
this.emit(‘:responseReady’); from within the intent handlers or when your session ends.
Saving attributes explicitly
Though, a user’s attributes are automatically saved when they end a session; sometimes, you may need to explicitly save them. For example, if a user ends the session by saying ‘quit’ or if the skill times out, you have to write code that saves the attributes.
You do that by adding the following line to the
AMAZON.CancelIntent function, add a
Inside the function, write
console.log('session ended!'); and