I believe this is a bug but wasn't sure where to raise it. It didn't seem to belong in the feature list as it's not a feature request.
Currently I cannot remove a session attribute from a skill or set it's value to null. I have to update the value with a custom value that I refer to as null.
I would have raised this as a bug in the java sdk which I am using, but noticed that using the same code and intents it works fine in the Test simulator but not on real devices.
I assume it may be something like devices caching the attributes.
Steps to reproduce:
In your code using the java sdk:
Then in the next intent, run this code:
In the Test simulator, this would have removed it and it will no longer be visible to the skill
However on real devices, this key is still present to the next intent.
Using the command line ask dialog works like a real device and does not remove the session attribute.
I will update my code to put in a custom null value so I can work round the problem, but a snippet of the interaction is below.
User > open memory game
Alexa > Welcome back to the Memory Game. What would you like to do? Remember you can always ask for help.
User > my daily colours are apple
Alexa > <ATTRIBUTE SET> You must wait a day before answering day games. Do you want to start a normal game with colours instead?
User > help
Alexa > <ATTRIBUTE REMOVED> In this game you can test your memory by repeating sequences. There are various modes and with various items to remember.
To start a simple game with COLOURS, just say 'start game'
You can play more advanced games by specifying the mode and items. For example: 'start a knockout game with numbers'.
You can also ask for help on specific topics, and for help with navigating this help just say 'help with help'!
To end at any point say: finish. What would you like to do now?
User > yes
Alexa > <ATTRIBUTE STILL PRESENT> You currently have a normal game with colours in progress. Do you want to overwrite it with a new normal game?