# Best practices SPA cookies (with custom domain) vs refreshtokens

**URL:** <https://community.auth0.com/t/best-practices-spa-cookies-with-custom-domain-vs-refreshtokens/156836>\
**Category:** Get Help\
**Tags:** configuration, application\
**Created:** [December 3, 2024, 8:44am UTC](https://community.auth0.com/t/best-practices-spa-cookies-with-custom-domain-vs-refreshtokens/156836 "2024-12-03T08:44:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris\_b](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/chris_b/32/72555_2.png) [@chris\_b](https://community.auth0.com/u/chris_b)\
**Post date:** [December 3, 2024, 8:44am UTC](https://community.auth0.com/t/best-practices-spa-cookies-with-custom-domain-vs-refreshtokens/156836/1 "2024-12-03T08:44:38Z")

</div>

Hi all,

we have a backend API with an angular SPA client. We recently added custom domains to our tenants, to have a more unified user experience. Until now I also thought that we should migrate from using refreshtokens with rotation to cookies (refreshtoken =false) since third party cookies should not be blocked now.

Is this correct? Is there a recommended approach? I just saw a few threads where people suggest that refreshtokens might be more futureproof since browsers are continueing to block cookies in general.

If using cookies with custom domains, how should we handle local testing - will this still work?

I would really appreciate some recommendations or best practices regarding this topic :).

Best  
Chris

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [December 30, 2024, 8:21pm UTC](https://community.auth0.com/t/best-practices-spa-cookies-with-custom-domain-vs-refreshtokens/156836/3 "2024-12-30T20:21:07Z")

</div>

Hi @chris_b

Welcome back to the Auth0 Community!

Refresh Token rotation It’s our recommended way of gaining the access token, due to, as you said, the current approach of browser to block cookies in general. You can read more about that here →

> **[Refresh Token Rotation](https://auth0.com/docs/secure/tokens/refresh-tokens/refresh-token-rotation#maintain-user-sessions-in-spas)**
>
> Describes how refresh token rotation provides greater security by issuing a new refresh token with each request made to Auth0 for a new access token by a client using refresh tokens.

Thanks  
Dawid

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [January 13, 2025, 8:21pm UTC](https://community.auth0.com/t/best-practices-spa-cookies-with-custom-domain-vs-refreshtokens/156836/4 "2025-01-13T20:21:23Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
