The ArcGIS Server JavaScript API contains a Bookmark dijit which allows users to add and delete bookmarks. These are not persisted between sessions, but are reset each time the page refreshes.

Has anyone written code which saves the bookmarks between sessions, and which they're willing to share?

Failing that, does anyone have any pointers as to how you'd go about writing this functionality?

Presumably you would need to save each BookmarkItem to a cookie and read them in again when the page loaded - are there any samples I can use as a starting point?

Ideally this would be tied to a user, but more realistically it could be tied to a browser only.

1 Answer 1


Yes, there's a sample in the SDK docs that shows this called Store Bookmarks Client Side:

The bookmarks widget does not natively persist bookmarks created by a user. This sample shows how to store user created bookmarks client side. When bookmarks are created, the app tries to store them in local storage. If local storage is not available, the app falls back to using a cookie.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.