Setting Persistent Values

The Wolfram Language allows values to be set up to be persistent beyond a single invocation of the language. The persistent values can be stored in a variety of locations, locally or in the cloud. Values can either be retrieved from a single location or can be aggregated from multiple locations. Persistent values are used, for example, to support web sessions, and also for general system initialization.

Referencing Persistent Values

PersistentSymbol settable persistent value

PersistentObject an object representing a stored persistent value

Persistence Locations

PersistenceLocation symbolic specification of a persistence location

"KernelSession" current invocation of the Wolfram Language kernel

"FrontEndSession" current invocation of the Wolfram notebook front end

"Notebook" stored in the current notebook

"Local" local to a computer, based on user home directory

"LocalShared" local to a computer, based on $BaseDirectory

"Cloud" in the cloud defined by the current $CloudBase

"Installation" built-in default settings for a given installation

$PersistenceBase default location at which to store newly defined persistent values

$PersistencePath default locations at which to look for requested persistent values

Managing Persistent Values

MergingFunction option to define how to merge values from different locations

PersistentObjects persistent objects with names matching a pattern

Persistent Values Used for Initialization »

InitializationValue persistent settable value initialized when sessions are started

InitializationObjects give existing initialization objects

$Initialization symbol whose value is released and evaluated at startup

$InitializationContexts  ▪  $PreInitialization  ▪  Initialize  ▪  ...