RetroFed Forum
Your home away from modern life.
Pseudo logged out on first visit
Post Reply
AuthorMessage
alakey piefed.social alakey@piefed.social
Joined: 2026-03-22
(edited) Quote

Since a day ago the first time I open piefed.social the website appears as if I'm logged out, but just clicking "log in" without going through the actual login process it fixes itself. Is it just me?

Update: any action "fixes" it for the session, not just clicking log in.

7   Original
wjs018 piefed.wjs018.xyz wjs018@piefed.wjs018.xyz
Joined: 2025-07-15
#2 · Quote Reply

Happened to me as well. I am willing to bet rimu did something with the web server that flushed caches or something.

1
Rimu piefed.social rimu@piefed.social
Joined: 2024-01-04
#3 · Quote Reply

Hmm. The first page you load is being cached, somewhere.

@shadow@lemmy.ca you changed something to do with caching recently, do you think this could be related?

2
pseudo jlai.lu pseudo@jlai.lu
Joined: 2023-07-07
#4 · Quote Reply

Sorry. I wasn't rude of purpose.

3
Shadow lemmy.ca Shadow@lemmy.ca
Joined: 2023-06-22
#5 · Quote Reply

Hmm. The first page you load is being cached, somewhere. @shadow@lemmy.ca you changed something to do with caching recently, do you think this could be related?

I think your nginx is returning a cached page even though the user is logged in, because nginx caching doesn't factor in request cookies - https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_key

Default: 	proxy_cache_key $scheme$proxy_host$request_uri;

Once a user does a privileged action now flask sends the first set-cookie header which starts bypassing the nginx cache (flask then does it on every subsequent req too). My varnish is set to not cache if there's request cookies, so that's why I haven't run into this.

I think this should fix - https://codeberg.org/rimu/pyfedi/pulls/1785

1
alakey piefed.social alakey@piefed.social
Joined: 2026-03-22
#6 · Quote Reply

I think your nginx is returning a cached page even though the user is logged in, because nginx caching doesn't factor in request cookies - https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_key Default: proxy_cache_key $scheme$proxy_host$request_uri; Once a user does a privileged action now flask sends the first set-cookie header which starts bypassing the nginx cache (flask ...

Even though this hasn't been merged yet, today the issue stopped occurring.

1
Post Reply
Back to top