Using Windows (e.g. 10 but I hope it doesn't matter), is there any kind of environment variable whose life ends with the user session in which the variable was created?
I'm talking about something a simple program (e.g. a .NET one) can use to store a value before shutting down, so that if the program is started again before the user logs off Windows, that value can be recovered; if the user logs off Windows, logs in and starts the said program, the variable won't be available anymore.
Requirements:
- I'm looking for an OS feature, not something I'll have to manage directly except creating it when the program is started in a new Windows session
- A file based mechanism will do too
- I don't want the mentioned program to lurk in memory and hold the variable, I want to kill the program and still have the variable inside Windows
- If the variable is encrypted, much better