I just started out with Alexa Skill development course on Codecademy. I was experimenting with session attributes with a very basic example. I have a LaunchRequest intent in which I am setting a session attribute to a particular value. And, I am using this attribute in another intent which is triggered on some utterance.
However, the value of session attribute when switching intent is undefined. Somehow, the session attribute value is not persisting between intents. I am testing my skill in simulator in the developer console.
This might sound to be a very amateur. Any help or resources will be highly appreciated. You can find my handler code below in Node.js
var handlers = { // Launch request 'LaunchRequest': function() { this.response.speak('Hey there. How are you?'); this.attributes.variable='hey'; this.emit(':responseReady'); }, //Session intent to use the previously defines attribute value sessionIntent: function(){ this.response.speak('Variable value is '+this.attributes.variable); this.emit(':responseReady'); } };