For Local Use...

Define a persistent value

To define a value that persists between kernel sessions, use PersistentValue:

Use a persistent value

Use a persistent value as you would any symbol:

The persistent value is not lost when the kernel is restarted:

Remove a persistent value

For Use Both on the Desktop and in the Cloud...

Define a persistent value

To define a value that persists between kernel sessions and can be used both on the desktop and in the cloud, put the value in the Cloud persistence location:

Use a persistent value

Use a persistent value as you would any symbol. Both desktop and cloud have access to the same persistent value:

The persistent value is not lost when the kernel is restarted:

Remove a persistent value

Notes

Persistent values defined in the default location in Wolfram Cloud are not available on the desktop and vice versa.