Terminal variables are called Global Variables in MetaTrader, because they are obviously variables that are global (can be accessed from all EAs). I called them Terminal, because the term "global variable" already has meaning for the EA itself. They are values written in some file I think, pretty much like the cookies in the browser, that's why they does not disappear for some time.
In MQL there are 2 general functions that are used to get and set them - GlobalVariableSet() and GlobalVariableGet(). Very, very basic. You can actually use those functions directly if you have to do something a little bit more complex. Otherwise there is a block to set them and also you can get and check their values somewhere in Condition (search for Terminal Variables).