Settings not saved when using __settings__.setSetting('setting', 'value')



This has been bugging me for some time so I thought I would ask.

Why is it when you use  __settings__.setSetting(‘setting’, ‘value’) in a python script it will set the setting with a new value and use the new value when using say xxx = __settings__.getSetting(‘setting’) in other places in your script while the app is still running but as soon as you close your app and reopen it, the value of the setting you changed while running your app previously does not hold. It reverts back to the value it was before opening your app or the value you set it to from the context menu of the app before opening it. The only way to make the value hold is if you set the setting before opening your app.

How can I make the setting that is changed from a python script to save and be the same if I close my app and reopen it?