# Reports of user logged out twice today - related to recent auth tokens changes?

**URL:** https://meta.discourse.org/t/reports-of-user-logged-out-twice-today-related-to-recent-auth-tokens-changes/57330
**Category:** Bug
**Created:** [13. Februar 2017 um 21:34 UTC](https://meta.discourse.org/t/reports-of-user-logged-out-twice-today-related-to-recent-auth-tokens-changes/57330 "2017-02-13T21:34:17Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![ChrisBeach](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisbeach/32/214628_2.png) [@ChrisBeach](https://meta.discourse.org/u/ChrisBeach)
#### Post date: [24. Februar 2017 um 09:57 UTC](https://meta.discourse.org/t/reports-of-user-logged-out-twice-today-related-to-recent-auth-tokens-changes/57330/25 "2017-02-24T09:57:11Z")

</div>

I found myself logged out of my forum when I opened the Discourse native iOS app this morning ☹

Haven’t seen similar happen on meta in the native app. Will keep an eye on things and let you know if it happens again.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [28. Februar 2017 um 15:51 UTC](https://meta.discourse.org/t/reports-of-user-logged-out-twice-today-related-to-recent-auth-tokens-changes/57330/26 "2017-02-28T15:51:24Z")

</div>

A couple of more fixes over the weekend and today to allow for iOS crazy

It seems that in certain cases

- We give webkit on iOS a new cookie
- It echos this cookie back to us
- (time passes)
- It sends us the old cookie instead of the new one (as if it did not flush the new cookie to disk)

I added a fix to allow for this situation better and a subsequent bugfix to the fix.

[https://github.com/discourse/discourse/commit/7e8f0dc967cb9764238f1937c57228e1322ed679](https://github.com/discourse/discourse/commit/7e8f0dc967cb9764238f1937c57228e1322ed679)

[https://github.com/discourse/discourse/commit/3ac47099031a1011a9ac80d648ed09808321ca20](https://github.com/discourse/discourse/commit/3ac47099031a1011a9ac80d648ed09808321ca20)

---

<div class="post-metadata">

### Author: ![ChrisBeach](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisbeach/32/214628_2.png) [@ChrisBeach](https://meta.discourse.org/u/ChrisBeach)
#### Post date: [28. Februar 2017 um 16:10 UTC](https://meta.discourse.org/t/reports-of-user-logged-out-twice-today-related-to-recent-auth-tokens-changes/57330/27 "2017-02-28T16:10:21Z")

</div>

Much appreciate your attention to detail. Cheers @Sam 👍

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2. März 2017 um 15:25 UTC](https://meta.discourse.org/t/reports-of-user-logged-out-twice-today-related-to-recent-auth-tokens-changes/57330/28 "2017-03-02T15:25:50Z")

</div>

Stuff has been looking much better on our side, will close this in 3 more days unless someone keeps seeing issues.

---

<div class="post-metadata">

### Author: ![ChrisBeach](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisbeach/32/214628_2.png) [@ChrisBeach](https://meta.discourse.org/u/ChrisBeach)
#### Post date: [2. März 2017 um 15:49 UTC](https://meta.discourse.org/t/reports-of-user-logged-out-twice-today-related-to-recent-auth-tokens-changes/57330/29 "2017-03-02T15:49:32Z")

</div>

Likewise, no issues reported in my forum since we last spoke. Thanks @Sam

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [3. März 2017 um 00:44 UTC](https://meta.discourse.org/t/reports-of-user-logged-out-twice-today-related-to-recent-auth-tokens-changes/57330/30 "2017-03-03T00:44:14Z")

</div>

4 posts were split to a new topic: [500 error when logging in – plugin related?](https://meta.discourse.org/t/500-error-when-logging-in-plugin-related/58266)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [5. März 2017 um 15:26 UTC](https://meta.discourse.org/t/reports-of-user-logged-out-twice-today-related-to-recent-auth-tokens-changes/57330/31 "2017-03-05T15:26:09Z")

</div>

This topic was automatically closed after 3 days. New replies are no longer allowed.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [7. März 2017 um 14:29 UTC](https://meta.discourse.org/t/reports-of-user-logged-out-twice-today-related-to-recent-auth-tokens-changes/57330/32 "2017-03-07T14:29:46Z")

</div>



---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [7. März 2017 um 14:34 UTC](https://meta.discourse.org/t/reports-of-user-logged-out-twice-today-related-to-recent-auth-tokens-changes/57330/34 "2017-03-07T14:34:31Z")

</div>

Reopened cause this issue is still happening, current issue is that once cookie gets corrupt, cause browser did not write it to disk users get a 500 error.

I am fixing that so at least they are simply logged off.

---

<div class="post-metadata">

### Author: ![DoMiN8ToR](https://avatars.discourse-cdn.com/v4/letter/d/b2d939/32.png) [@DoMiN8ToR](https://meta.discourse.org/u/DoMiN8ToR)
#### Post date: [7. März 2017 um 14:58 UTC](https://meta.discourse.org/t/reports-of-user-logged-out-twice-today-related-to-recent-auth-tokens-changes/57330/35 "2017-03-07T14:58:33Z")

</div>

Ah yes, I guess therefore a simple logout and login fixed the error 500 issue for me?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [7. März 2017 um 15:16 UTC](https://meta.discourse.org/t/reports-of-user-logged-out-twice-today-related-to-recent-auth-tokens-changes/57330/36 "2017-03-07T15:16:17Z")

</div>

Yes, that would be it, I am fixing the edge case here, what browser were you using when you experienced the issue here.

I honestly never knew it would be this hard to convince web browsers to write a cookie to disk.

---

<div class="post-metadata">

### Author: ![DoMiN8ToR](https://avatars.discourse-cdn.com/v4/letter/d/b2d939/32.png) [@DoMiN8ToR](https://meta.discourse.org/u/DoMiN8ToR)
#### Post date: [7. März 2017 um 15:18 UTC](https://meta.discourse.org/t/reports-of-user-logged-out-twice-today-related-to-recent-auth-tokens-changes/57330/37 "2017-03-07T15:18:11Z")

</div>

It happened to me on our hosted Discourse instance (by you) several times today. I’m using Chrome 56.0.2924.87 (64-bit) on Windows 10.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [7. März 2017 um 15:31 UTC](https://meta.discourse.org/t/reports-of-user-logged-out-twice-today-related-to-recent-auth-tokens-changes/57330/38 "2017-03-07T15:31:11Z")

</div>

I enabled verbose auth token logging on your instance, let me know when it happens next

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [7. März 2017 um 18:48 UTC](https://meta.discourse.org/t/reports-of-user-logged-out-twice-today-related-to-recent-auth-tokens-changes/57330/39 "2017-03-07T18:48:46Z")

</div>

I hate to leave this topic open forever, but yet again we saw the exact issue across various browsers.

I just made some changes to adjust the process of dealing with invalid tokens a bit. In particular I eliminated the chance of getting the 500 errors people were seeing, added more logging and handled a corner case where we are presented with old tokens a bit better.

Let’s see how it goes.

[https://github.com/discourse/discourse/commit/99f4d5082b6c9f0970a092ef96c3b9ade0cef3d0](https://github.com/discourse/discourse/commit/99f4d5082b6c9f0970a092ef96c3b9ade0cef3d0)

---

<div class="post-metadata">

### Author: ![DoMiN8ToR](https://avatars.discourse-cdn.com/v4/letter/d/b2d939/32.png) [@DoMiN8ToR](https://meta.discourse.org/u/DoMiN8ToR)
#### Post date: [7. März 2017 um 22:07 UTC](https://meta.discourse.org/t/reports-of-user-logged-out-twice-today-related-to-recent-auth-tokens-changes/57330/40 "2017-03-07T22:07:31Z")

</div>

I just had it on our site again. Same browser, I hope the error helps you in fixing the issue.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [7. März 2017 um 22:36 UTC](https://meta.discourse.org/t/reports-of-user-logged-out-twice-today-related-to-recent-auth-tokens-changes/57330/42 "2017-03-07T22:36:34Z")

</div>

Thanks! just redeployed my fixes from earlier on to your site, can you ping me again next time it happens.

You should not see a 500 error anymore, but a random logout is possible.

Can you tell me a bit more about how you are using your browser, do you have lots of tabs open to your site?

---

<div class="post-metadata">

### Author: ![DoMiN8ToR](https://avatars.discourse-cdn.com/v4/letter/d/b2d939/32.png) [@DoMiN8ToR](https://meta.discourse.org/u/DoMiN8ToR)
#### Post date: [7. März 2017 um 23:07 UTC](https://meta.discourse.org/t/reports-of-user-logged-out-twice-today-related-to-recent-auth-tokens-changes/57330/43 "2017-03-07T23:07:55Z")

</div>

I will let you know when it happens again.Re: tabs → I think usually 1-4 tabs open on our site.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [8. März 2017 um 21:47 UTC](https://meta.discourse.org/t/reports-of-user-logged-out-twice-today-related-to-recent-auth-tokens-changes/57330/44 "2017-03-08T21:47:17Z")

</div>

Have you noticed any random logout since yesterday?

---

<div class="post-metadata">

### Author: ![DoMiN8ToR](https://avatars.discourse-cdn.com/v4/letter/d/b2d939/32.png) [@DoMiN8ToR](https://meta.discourse.org/u/DoMiN8ToR)
#### Post date: [9. März 2017 um 08:56 UTC](https://meta.discourse.org/t/reports-of-user-logged-out-twice-today-related-to-recent-auth-tokens-changes/57330/45 "2017-03-09T08:56:43Z")

</div>

No, not anymore. Maybe other users but haven’t received any reports.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [10. März 2017 um 20:25 UTC](https://meta.discourse.org/t/reports-of-user-logged-out-twice-today-related-to-recent-auth-tokens-changes/57330/46 "2017-03-10T20:25:27Z")

</div>

Anyone still getting issues? I have not noticed anything since my last round of changes.

[Vorherige Seite](https://meta.discourse.org/t/reports-of-user-logged-out-twice-today-related-to-recent-auth-tokens-changes/57330.md?page=1)

[Nächste Seite](https://meta.discourse.org/t/reports-of-user-logged-out-twice-today-related-to-recent-auth-tokens-changes/57330.md?page=3)
