title: adding alexa skill session attributes from nodejs
body: <p>using session attributes in alexa skill in nodejs code</p>
  
  <p><img src="https://i.stack.imgur.com/i9gCj.png" alt="code"></p>
  
  <p>But getting output undefined. Undefined should be a fashion.</p>
  
  <p><img src="https://i.stack.imgur.com/RqNex.png" alt="undefined should be fashion">. </p>
  
  <p>Please refer to images for the code</p>
  
  <pre><code>    'expenseIntent': function () {
      var updatedIntent=this.event.request.intent;
      var category1 = this.event.request.intent.slots.category.value;
      var expense;
      if(category1=='fashion'){
          expense = '1000';
      }else if(category1=='travel'){
  
          expense = '2000';
      }else if(category1=='food'){
  
          expense = '3000';
      }else {
  
          expense = '4000';
      }
      this.attributes.lastSpeech = this.event.request.intent.slots.category.value;
      console.log(this.attributes);
      if (this.event.request.dialogState === "STARTED") {
      this.emit(":delegate", updatedIntent);
      }else if(this.event.request.dialogState !== "COMPLETED"){
      this.emit(":delegate", updatedIntent);
      }else {
      console.log("this.event.request.intent.slots.category.value"+this.event.request.intent.slots.category.value);
      this.response.speak("Amount spent on "+category1+" is " + expense);
      this.emit(':responseReady'); 
  }
  },
  'intentTwo': function () {
      var a = this.attributes.lastSpeech;
  
      //var aa = this.event.request.intent.slots.categories.value;
      this.response.speak("you query was about " + a);
      this.emit(':responseReady');
  },
  </code></pre>