In both Illustrator and Photoshop, the Export for Web window has three options at the bottom:
Done, Cancel and Save
Save will save the image for Web with the settings that you have selected.
However, Done and Cancel seem to do exactly the same thing: close the window without performing any saving action.
Why are there two options that seem to do the same thing?