Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • Wolfram Notebook Assistant + LLM Kit

    All-in-one AI assistance for your Wolfram experience

  • System Modeler
  • Wolfram Player
  • Finance Platform
  • Wolfram Engine
  • Enterprise Private Cloud
  • Application Server
  • Wolfram|Alpha Notebook Edition
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • AI & Linguistic Understanding

Deployment Options

  • Wolfram Cloud
  • wolframscript
  • Wolfram Engine Community Edition
  • Wolfram LLM API
  • WSTPServer
  • Wolfram|Alpha APIs

From the Community

  • Function Repository
  • Community Paclet Repository
  • Example Repository
  • Neural Net Repository
  • Prompt Repository
  • Wolfram Demonstrations
  • Data Repository
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

  • Data & Computational Intelligence
  • Model-Based Design
  • Algorithm Development
  • Wolfram|Alpha for Business
  • Blockchain Technology
  • Education Technology
  • Quantum Computation

WolframConsulting.com

Wolfram Solutions

  • Data Science
  • Artificial Intelligence
  • Biosciences
  • Healthcare Intelligence
  • Sustainable Energy
  • Control Systems
  • Enterprise Wolfram|Alpha
  • Blockchain Labs

More Wolfram Solutions

Wolfram Solutions For Education

  • Research Universities
  • Colleges & Teaching Universities
  • Junior & Community Colleges
  • High Schools
  • Educational Technology
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM/STEAM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
Wolfram|Alpha
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • Wolfram Notebook Assistant + LLM Kit
    • System Modeler
    • Wolfram Player
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Wolfram Engine
    • Enterprise Private Cloud
    • Application Server
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • AI & Linguistic Understanding
    • Deployment Options
      • Wolfram Cloud
      • wolframscript
      • Wolfram Engine Community Edition
      • Wolfram LLM API
      • WSTPServer
      • Wolfram|Alpha APIs
    • From the Community
      • Function Repository
      • Community Paclet Repository
      • Example Repository
      • Neural Net Repository
      • Prompt Repository
      • Wolfram Demonstrations
      • Data Repository
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions

    We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

    WolframConsulting.com

    Wolfram Solutions

    • Data Science
    • Artificial Intelligence
    • Biosciences
    • Healthcare Intelligence
    • Sustainable Energy
    • Control Systems
    • Enterprise Wolfram|Alpha
    • Blockchain Labs

    More Wolfram Solutions

    Wolfram Solutions For Education

    • Research Universities
    • Colleges & Teaching Universities
    • Junior & Community Colleges
    • High Schools
    • Educational Technology
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM/STEAM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • Wolfram|Alpha
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
PersistentSymbol
  • See Also
    • PersistentObject
    • PersistenceLocation
    • $PersistencePath
    • $PersistenceBase
    • PersistentObjects
    • InitializationValue
    • ExternalValue
  • Related Guides
    • Setting Persistent Values
    • Persistent Storage
  • Workflows
    • Persist Values between Sessions
    • See Also
      • PersistentObject
      • PersistenceLocation
      • $PersistencePath
      • $PersistenceBase
      • PersistentObjects
      • InitializationValue
      • ExternalValue
    • Related Guides
      • Setting Persistent Values
      • Persistent Storage
    • Workflows
      • Persist Values between Sessions

PersistentSymbol["name"]

represents the persistent symbol associated with the key "name".

PersistentSymbol["name",loc]

represents the persistent symbol associated with name stored in persistence location loc.

PersistentSymbol["name",{loc1,…}]

represents the persistent symbol associated with name at the first of the locations loci at which it occurs.

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Persistence Locations  
Reassignment Functions  
Options  
ExpirationDate  
MergingFunction  
PersistenceTime  
ValuePreprocessingFunction  
Applications  
Properties & Relations  
Possible Issues  
See Also
Related Guides
Related Workflows
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • PersistentObject
    • PersistenceLocation
    • $PersistencePath
    • $PersistenceBase
    • PersistentObjects
    • InitializationValue
    • ExternalValue
  • Related Guides
    • Setting Persistent Values
    • Persistent Storage
  • Workflows
    • Persist Values between Sessions
    • See Also
      • PersistentObject
      • PersistenceLocation
      • $PersistencePath
      • $PersistenceBase
      • PersistentObjects
      • InitializationValue
      • ExternalValue
    • Related Guides
      • Setting Persistent Values
      • Persistent Storage
    • Workflows
      • Persist Values between Sessions

PersistentSymbol

PersistentSymbol["name"]

represents the persistent symbol associated with the key "name".

PersistentSymbol["name",loc]

represents the persistent symbol associated with name stored in persistence location loc.

PersistentSymbol["name",{loc1,…}]

represents the persistent symbol associated with name at the first of the locations loci at which it occurs.

Details and Options

  • PersistentSymbol["name",…] evaluates to give the corresponding persistent value.
  • PersistentSymbol["name",…]=value sets a persistent value.
  • PersistentSymbol allows the following options:
  • MergingFunction Automaticthe function applied to the list of values found
    ValuePreprocessingFunction Identitythe function applied to new values to be assigned
    ExpirationDate Nonewhen the value should expire
    PersistenceTime Nonehow long the value should persist
  • In PersistentSymbol["name",loc], possible forms for the persistence location loc include:
  • PersistenceLocation["type"]"Local", "Cloud", "FrontEndSession", etc. locations
    "type"equivalent to PersistenceLocation["type"]
    PersistenceLocation["type","base"]location with a particular base (directory etc.)
    "type""base"equivalent to PersistenceLocation["type","base"]
  • Supported location types include:
  • "KernelSession"current invocation of the Wolfram Language kernel
    "FrontEndSession"current invocation of the Wolfram Notebook front end
    "Notebook"the notebook in which the current evaluation is being done
    "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"installation defaults
  • PersistentSymbol["name"] is equivalent to PersistentSymbol["name",$PersistencePath].
  • PersistentSymbol["name"]=value is equivalent to PersistentSymbol["name",$PersistenceBase]=value.
  • PersistentSymbol["name",loc] is essentially PersistentObject["name",loc]["Value"].
  • When a single persistence location is specified, as in PersistentSymbol["name",loc,…], the setting for MergingFunction is not used.
  • Otherwise, with the setting MergingFunction->f, the final value returned is the result of applying the function f to the list of values found at all persistence locations.
  • Unless specified otherwise by "MergingFunction" metadata in the PersistentObject, MergingFunction->Automatic is equivalent to MergingFunction->First.
  • Before a new value is assigned in PersistentSymbol[sym]=value, any specified value preprocessing function is applied to value before the value is assigned.
  • If the preprocessing function returns $Failed, the assignment is not performed.
  • If no explicit setting for ValuePreprocessingFunction is given, the setting to use is looked up on $PersistencePath.
  • An expired persistent symbol is treated as nonexistent, and the underlying persistent object may be removed.
  • Persistent symbols can be removed with Remove. Remove[PersistentSymbol["name"]] is equivalent to Remove[PersistentSymbol["name",$PersistenceBase]].

Examples

open all close all

Basic Examples  (3)

Assign a persistent value:

Retrieve a previously saved value:

Remember a value with front end session scope:

Use the saved value, even in a newly restarted kernel within the same front end session:

Store values for the same name at different persistence locations:

Retrieve the first value found:

Retrieve the list of all values on $PersistencePath:

Scope  (8)

Persistence Locations  (3)

Persistent symbols created in the "KernelSession" location disappear when the kernel quits:

Persistent symbols created in the "FrontEndSession" location survive a kernel restart:

These symbols disappear when the front end is restarted:

Persistent symbols in the "Local" location are stored in a file in your account:

These symbols are stored under the $LocalBase directory and remain indefinitely:

Reassignment Functions  (5)

Modify values of persistent symbols:

Modify list values:

Modify parts of list values:

Modify association values:

Modify elements of association values:

Options  (8)

ExpirationDate  (2)

Define a persistent value that expires at the beginning of the year 2020:

Verify the expiration date of the underlying persistent object:

Define a persistent value that expires at the beginning of next year:

Verify the expiration date of the underlying persistent object:

MergingFunction  (3)

Create a complement of persistent values with key "lval" at various locations:

List all existing values for the key "lval" on $PersistencePath:

By default, only the first value is returned:

Join and flatten all sublists:

Join all sublists:

Create a complement of persistent associations with name "aval" at various locations:

List all existing values on $PersistencePath:

Merge the values of identical keys in the associations:

Define a default value for "mylist" with a custom merging function:

Define additional values at different persistence locations:

For looking up values, the custom merging function is now used:

PersistenceTime  (2)

Define a persistent value that expires in 5 seconds:

After 5 seconds, it is no longer used:

Define a persistent object that expires in 5 days:

Verify the expiration date of the underlying persistent object:

ValuePreprocessingFunction  (1)

Define a value preprocessing function that accepts only integers:

Set up a default value and the value preprocessing function for a persistent value named "int":

Assign an integer at any persistence location:

Assigning anything else generates an error, and the assignment is not performed:

Applications  (1)

List all existing persistent objects for the key "lval":

Delete them:

Properties & Relations  (5)

Persistent values are stored in persistent objects:

The default location of a new persistent object is given by $PersistenceBase:

Create a complement of persistent values with key "v" at various locations:

Persistent values are by default searched on all locations given in $PersistencePath:

The first value found is returned:

With MergingFunction->Identity, all values found are returned in a list:

Specify an explicit list of locations to search for values:

Expiration times specified with PersistenceTime are converted to absolute expiration dates:

Persistent values can be removed with Remove:

Possible Issues  (1)

Create two persistent values for "name" in different locations:

Remove by default removes only the value in the location given by $PersistenceBase:

Remove all values that might exist anywhere in the locations given by $PersistencePath:

See Also

PersistentObject  PersistenceLocation  $PersistencePath  $PersistenceBase  PersistentObjects  InitializationValue  ExternalValue

Related Guides

    ▪
  • Setting Persistent Values
  • ▪
  • Persistent Storage

Related Workflows

    Related Workflows
    ▪
  • Persist Values between Sessions

History

Introduced in 2021 (12.3)

Wolfram Research (2021), PersistentSymbol, Wolfram Language function, https://reference.wolfram.com/language/ref/PersistentSymbol.html.

Text

Wolfram Research (2021), PersistentSymbol, Wolfram Language function, https://reference.wolfram.com/language/ref/PersistentSymbol.html.

CMS

Wolfram Language. 2021. "PersistentSymbol." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PersistentSymbol.html.

APA

Wolfram Language. (2021). PersistentSymbol. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PersistentSymbol.html

BibTeX

@misc{reference.wolfram_2025_persistentsymbol, author="Wolfram Research", title="{PersistentSymbol}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/PersistentSymbol.html}", note=[Accessed: 01-December-2025]}

BibLaTeX

@online{reference.wolfram_2025_persistentsymbol, organization={Wolfram Research}, title={PersistentSymbol}, year={2021}, url={https://reference.wolfram.com/language/ref/PersistentSymbol.html}, note=[Accessed: 01-December-2025]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Player
  • Wolfram Engine

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2025 Wolfram
© 2025 Wolfram | Legal & Privacy Policy |
English