Both $:/temp and $:/state are ignored when determining if the document is "dirty" (see $:/core/SaverFilter)... and by default both are saved when you save the file (except for $:/state/popup, which are NOT saved... see $:/core/save/all)
However, conceptually, $:/temp tiddlers should be "throw-away"... able to be discarded when not actually in use, while $:/state tiddlers should reasonably be expected to persist across sessions.
To enforce this difference, I routinely create a tiddler, tagged with $:/tags/Macro, containing:
\define publishFilter() -[prefix[$:/temp]]
This variable is automatically included by the $:/core/save/all filter. The effect is that $:/temp tiddlers are NOT saved when you save the file and are, in effect, automatically discarded at the end of the session.
Thus, if I want a reveal state to always revert to closed on startup, I will use a $:/temp tiddler, but if I want the reveal state to persist across sessions, I will use a $:/state tiddler
-e