# Cache Visitor Indentification API Token

**URL:** <https://community.hubspot.com/t/cache-visitor-indentification-api-token/51692>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [February 16, 2022, 9:21pm UTC](https://community.hubspot.com/t/cache-visitor-indentification-api-token/51692 "2022-02-16T21:21:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tryinteract](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/tryinteract/32/79644_2.png) [@tryinteract](https://community.hubspot.com/u/tryinteract)\
**Post date:** [February 16, 2022, 9:21pm UTC](https://community.hubspot.com/t/cache-visitor-indentification-api-token/51692/1 "2022-02-16T21:21:21Z")

</div>

Hello!

What is the suggested practice for caching an identification token provided by the Visitor Identification API token? The docs suggest “Tokens are temporary and will expire after 12 hours. Tokens can be cached to avoid re-fetching the token on every page load, as long as they are refreshed at least every 12 hours.”

What is the best practice here? Can these be stored on the client (ie cookies, local storage, etc) or do they need to be cached in a database.

Cheers.

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [February 17, 2022, 6:45pm UTC](https://community.hubspot.com/t/cache-visitor-indentification-api-token/51692/2 "2022-02-17T18:45:02Z")

</div>

@RomanGruit

Do you happen to have any advice for @tryinteract ?

---

<div class="post-metadata">

**Author:** ![RomanGruit](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/romangruit/32/84954_2.png) [@RomanGruit](https://community.hubspot.com/u/RomanGruit)\
**Post date:** [February 18, 2022, 9:14pm UTC](https://community.hubspot.com/t/cache-visitor-indentification-api-token/51692/3 "2022-02-18T21:14:25Z")

</div>

Hi @tryinteract!  
It’s a great question.  
I would definitely store a Visitor Identification API token on the server-side(database) with other user credentials. The same user might use different devices and browsers.  
Optionally, It might be a good idea to store the token in client-side(local storage, session storage) to avoid refetching the token on the next page load.  
Best regards,  
Roman

---

<div class="post-metadata">

**Author:** ![RC\_ZM0314](https://avatars.discourse-cdn.com/v4/letter/r/a183cd/32.png) [@RC\_ZM0314](https://community.hubspot.com/u/RC_ZM0314)\
**Post date:** [March 24, 2025, 3:46pm UTC](https://community.hubspot.com/t/cache-visitor-indentification-api-token/51692/4 "2025-03-24T15:46:08Z")

</div>

I am also looking for the same solution how to cache a generated token from a Visitor Identification API call.
