# Logout redirect failing - Cookie rejected

**URL:** <https://www.thethingsnetwork.org/forum/t/logout-redirect-failing-cookie-rejected/40171>\
**Category:** The Things Stack v3\
**Created:** [September 27, 2020, 8:56am UTC](https://www.thethingsnetwork.org/forum/t/logout-redirect-failing-cookie-rejected/40171 "2020-09-27T08:56:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastianb](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/sebastianb/32/44929_2.png) [@sebastianb](https://www.thethingsnetwork.org/forum/u/sebastianb)\
**Post date:** [September 27, 2020, 8:56am UTC](https://www.thethingsnetwork.org/forum/t/logout-redirect-failing-cookie-rejected/40171/1 "2020-09-27T08:56:48Z")

</div>

Currently experimenting with various stack setup variations,  
i do **docker on CentOS with postgreSQL** ,  
installed via script derived from @htdvisser s great **bootstrap script** (thanks for sharing that again!),  
and shared [here](https://github.com/sebastianbuettrich/The-Things-Stack-Bootstrap-CentOS-Postgres)

In short, everything works fine, console and cli, tokens, oauth -  
with one small nuisance that i cant figure out:

When logging out, logout works,  
however the redirect fails with browser response:

[https://mydomain.com/oauth/logout?access\_token\_id=](https://mydomain.com/oauth/logout?access_token_id=)&post\_logout\_redirect\_uri=%2Fconsole

> The page isn’t redirecting properly  
> An error occurred during a connection to \<[mydomain.com](http://mydomain.com)\>.  
> This problem can sometimes be caused by disabling or refusing to accept cookies.

The browser debug console offers two hints:

> Some cookies are misusing the recommended “SameSite“ attribute.  
> Cookie “\_console\_auth” has been rejected because it is already expired.

The latter one is probably the cause of the problem (?).

Logout behaviour seems a bit tricky in general:  
In discussion on slack, the advice has been given (by @kschiffer) to try

> ttn-lw-cli clients update console --logout-redirect-uri “[https://mydomain.com/console](https://mydomain.com/console)” --logout-redirect-uri “/console”

however that yields a result

> unknown flag: --oauth-logout-redirect-uri

and no such configuration setting is documented in  
[https://thethingsstack.io/reference/configuration/](https://thethingsstack.io/reference/configuration/)

so, my question is  
where do i look to fix error above,  
and where do i look for general logout redirects?

cheers,  
sebastian

---

<div class="post-metadata">

**Author:** ![sebastianb](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/sebastianb/32/44929_2.png) [@sebastianb](https://www.thethingsnetwork.org/forum/u/sebastianb)\
**Post date:** [October 20, 2020, 8:33pm UTC](https://www.thethingsnetwork.org/forum/t/logout-redirect-failing-cookie-rejected/40171/2 "2020-10-20T20:33:59Z")

</div>

self comment: never found any answer to this - it s now at

> <https://github.com/TheThingsNetwork/lorawan-stack/issues/3371>
>
> Summary
> When oauth clients are setup without --logout-redirect-uri, it can lead to the redirect URI being set as / which will cause...

---

<div class="post-metadata">

**Author:** ![system](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/6/2/6250ea44fd2b0d6259489e1a92748df681e1f970.png) [@system](https://www.thethingsnetwork.org/forum/u/system)\
**Post date:** [October 27, 2020, 8:56am UTC](https://www.thethingsnetwork.org/forum/t/logout-redirect-failing-cookie-rejected/40171/3 "2020-10-27T08:56:52Z")

</div>

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