# Why is authentication lost after refreshing my single page application in Chrome?

**URL:** <https://community.auth0.com/t/why-is-authentication-lost-after-refreshing-my-single-page-application-in-chrome/68713>\
**Category:** Get Help\
**Tags:** auth0-spa-js, authentication, silent-auth, silent-authenticatio\
**Created:** [August 27, 2021, 8:57pm UTC](https://community.auth0.com/t/why-is-authentication-lost-after-refreshing-my-single-page-application-in-chrome/68713 "2021-08-27T20:57:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rstardev](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rstardev/32/12970_2.png) [@rstardev](https://community.auth0.com/u/rstardev)\
**Post date:** [August 27, 2021, 8:57pm UTC](https://community.auth0.com/t/why-is-authentication-lost-after-refreshing-my-single-page-application-in-chrome/68713/1 "2021-08-27T20:57:15Z")

</div>

I have problems with silent reauthentication in the “latest” Chrome 92.

I’ve read and understand the well described topic in [Why is authentication lost after refreshing my single page application?](https://community.auth0.com/t/why-is-authentication-lost-after-refreshing-my-single-page-application/56276) but currently there appears to be a problem in Chrome only currently. My application has no Social Connection configured , it’s only the **username/password** method allowed, Chrome is with set allowed third-party cookies and I can see that after valid login the cookies properly set to **true** , but on refresh they are cleared (after the silent request to Auth0 server).

There are no issues with Firefox for instance. There’s also no problem if I set the **localstorage** as **cacheLocation**.

What could be the problem? Is it something Chrome has “changed”, or something locally on my side?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [August 31, 2021, 9:37pm UTC](https://community.auth0.com/t/why-is-authentication-lost-after-refreshing-my-single-page-application-in-chrome/68713/3 "2021-08-31T21:37:46Z")

</div>

Hi @rstardev,

Welcome to the Auth0 Community!

How are you implementing silent auth? Did you follow one of our [quickstarts](https://auth0.com/docs/quickstarts/)?

Also, are you seeing any errors in the development console of Chrome or in the Auth0 Dashboard?

---

<div class="post-metadata">

**Author:** ![rstardev](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rstardev/32/12970_2.png) [@rstardev](https://community.auth0.com/u/rstardev)\
**Post date:** [September 1, 2021, 7:02pm UTC](https://community.auth0.com/t/why-is-authentication-lost-after-refreshing-my-single-page-application-in-chrome/68713/4 "2021-09-01T19:02:22Z")

</div>

Hi, yes I just used the vanilla JS quickstart.  
Actually it is reproducible with the quickstart sample app (e.g the [https://github.com/auth0-samples/auth0-javascript-samples/tree/master/01-Login](https://github.com/auth0-samples/auth0-javascript-samples/tree/master/01-Login) repository).

In fact I see Firefox is logging some info which can give more insight for the reason why it doesn’t work in Chrome.

> Cookie “auth0.is.authenticated” will be soon rejected because it has the “SameSite” attribute set to “None” or an invalid value, without the “secure” attribute. To know more about the “SameSite“ attribute, read [Set-Cookie - HTTP | MDN](https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite)

And I’m 99% sure Chrome already rejects such cookies.  
I guess there’ll be no problem when set custom domain as then the SPA and the authorization server will be from the same domain

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [September 2, 2021, 8:25pm UTC](https://community.auth0.com/t/why-is-authentication-lost-after-refreshing-my-single-page-application-in-chrome/68713/5 "2021-09-02T20:25:51Z")

</div>

> [@rstardev](#):
>
> Actually it is reproducible with the quickstart sample app (e.g the [auth0-javascript-samples/01-Login at master · auth0-samples/auth0-javascript-samples · GitHub\</t](https://github.com/auth0-samples/auth0-javascript-samples/tree/master/01-Login) repository).

If I boot up our vanilla js quickstart in chrome 92:latest everything works as expected. Can you provide a [HAR](https://auth0.com/docs/troubleshoot/guides/generate-har-files) of your failed transaction in a DM please?

> [@rstardev](#):
>
> There are no issues with Firefox for instance. There’s also no problem if I set the **localstorage** as **cacheLocation**.

Is there a reason why you don’t use this strategy?

---

<div class="post-metadata">

**Author:** ![rstardev](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rstardev/32/12970_2.png) [@rstardev](https://community.auth0.com/u/rstardev)\
**Post date:** [September 3, 2021, 7:28am UTC](https://community.auth0.com/t/why-is-authentication-lost-after-refreshing-my-single-page-application-in-chrome/68713/6 "2021-09-03T07:28:03Z")

</div>

I currently use the **localstorage** strategy, no issues with it, it’s perfect.

But as the cookies is the default one when starting the project I was at first puzzled what and why it’s not working, and was just going to try Okta when I saw it’s actually working in Firefox and started digging more to find out why from dev’s perspective.

As you said it’s working for you properly I even more started to think it’s just something specific on my Chrome. And finally I think I found out why. It’s because of this Chrome extension **Privacy Badger** [Privacy Badger - Chrome Web Store](https://chrome.google.com/webstore/detail/privacy-badger/pkehgijcmpdhfbdbbnkijodmdjhbjlgp).

So there’s nothing wrong with Auth0. What and why **Privacy Badger** does so that it prevents these Auth0 cookies I don’t know.

Thanks for your assistance , I believe this “issue” can be resolved now.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [September 3, 2021, 10:50pm UTC](https://community.auth0.com/t/why-is-authentication-lost-after-refreshing-my-single-page-application-in-chrome/68713/7 "2021-09-03T22:50:06Z")

</div>

Thanks for following up.

---

<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:** [September 18, 2021, 10:50pm UTC](https://community.auth0.com/t/why-is-authentication-lost-after-refreshing-my-single-page-application-in-chrome/68713/8 "2021-09-18T22:50:29Z")

</div>

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