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

(RefLink[PersistentValue, paclet:ref/PersistentValue]) — settable persistent value

(RefLink[PersistentObject, paclet:ref/PersistentObject]) — an object representing a stored persistent value

Persistence Locations

(RefLink[PersistenceLocation, paclet:ref/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 (RefLink[$BaseDirectory, paclet:ref/$BaseDirectory])

"Cloud" — in the cloud defined by the current (RefLink[$CloudBase, paclet:ref/$CloudBase])

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

(RefLink[$PersistenceBase, paclet:ref/$PersistenceBase]) — default location at which to store newly defined persistent values

(RefLink[$PersistencePath, paclet:ref/$PersistencePath]) — default locations at which to look for requested persistent values

Managing Persistent Values

(RefLink[MergingFunction, paclet:ref/MergingFunction]) — option to define how to merge values from different locations

(RefLink[PersistentObjects, paclet:ref/PersistentObjects]) — persistent objects with names matching a pattern

(OrangeLink[Persistent Values Used for Initialization », paclet:guide/InitializationAndProvisioning])

(RefLink[InitializationValue, paclet:ref/InitializationValue]) — persistent settable value initialized when sessions are started

(RefLink[InitializationObjects, paclet:ref/InitializationObjects]) — give existing initialization objects

(RefLink[$Initialization, paclet:ref/$Initialization]) — symbol whose value is released and evaluated at startup