({{, (RefLink[$PersistenceBase, paclet:ref/$PersistenceBase]) 
gives the default persistence location at which to store new values assigned to (RefLink[PersistentValue, paclet:ref/PersistentValue]) objects.}})

OpenersNotesSection(Spacer1)Details

The value of (RefLink[$PersistenceBase, paclet:ref/$PersistenceBase]) is a persistence location.

A persistence location is given as (RefLink[PersistenceLocation, paclet:ref/PersistenceLocation])["type"] or "type".

The initial setting of (RefLink[$PersistenceBase, paclet:ref/$PersistenceBase]) is (RefLink[PersistenceLocation, paclet:ref/PersistenceLocation])["Local"].

(RefLink[PersistentValue, paclet:ref/PersistentValue])["name"]=value is equivalent to (RefLink[PersistentValue, paclet:ref/PersistentValue])["name",$PersistenceBase]=value.

OpenersPrimaryExamplesSection(Spacer1)Examples  (3)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

The default location where new persistent values are stored:

$PersistenceBase

Change the value to the kernel session location for the duration of a kernel session:

$PersistenceBase="KernelSession"

OpenersExampleSection1(Spacer1)Scope  (1)

Specify a persistence location using its short name:

$PersistenceBase="KernelSession"

Specify a persistence location using (RefLink[PersistenceLocation, paclet:ref/PersistenceLocation]):

$PersistenceBase=PersistenceLocation["Local"]

Specify an alternate local location by giving the base directory as second argument:

$PersistenceBase=PersistenceLocation["Local",FileNameJoin[{CreateDirectory[],"Test"}]]

OpenersExampleSection3(Spacer1)Properties & Relations  (1)

The default location of a new persistent object is given by (RefLink[$PersistenceBase, paclet:ref/$PersistenceBase]):

PersistentValue["nv"]=3;

PersistentObject["nv",$PersistenceBase]["Value"]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[PersistentValue, paclet:ref/PersistentValue])  ▪  (RefLink[$PersistencePath, paclet:ref/$PersistencePath])  ▪  (RefLink[PersistenceLocation, paclet:ref/PersistenceLocation])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Initialization & Provisioning, paclet:guide/InitializationAndProvisioning])}, {▪(RefLinkPlain[Setting Persistent Values, paclet:guide/SettingPersistentValues])}})}})