Closed fyvfy closed 2 years ago
nothing logged when succesfully accessing web app page after logout
So I assume you've loaded the site from browser-cache instead from the server…
Try opening the web-dev-tools (Ctrl+I) and enable "disable cache" and this should no longer happen… If so: Your browser cached the site and as the request is not reaching the server the login dialog will not be shown…
"web-dev-tools (Ctrl+I)" - is that "developer tools"? Probably correct shortcut would be ctrl+shift+i. Anyway, cannot find "disable cache" option. Quick googling found "disable http cache" in firefox, but this option only applies while "developer tools" are open on this particular page. I'm using chromium (v100.0.4896.75, but I encountered this bug when I tried to set up nginx-sso for the first time ~half a year ago), usually "incognito mode" (so no plugins/no extensions).
I found "expires -1;" option for nginx. Well, if i add it to "http" context in /etc/nginx/nginx.conf it fixes the bug.
Well, you can't prevent the browser from using its cache if you let the browser cache the site. If there is no request to the nginx server, nginx-sso cannot tell nginx to not fulfill the request.
If setting an expires
header fixes the "bug" for you, you are exactly experiencing this: The browser cached a valid response and delivers it. Only when forced to refresh the cache through the server, nginx-sso is asked to validate the session and can deny delivering the site.
This is no "bug" in nginx-sso: nginx-sso wasn't even asked for the site to be displayed. If you want to validate the session on every request you need to make sure every request goes through the server instead to be handled by local browser cache.
As this is about general web mechanics and not an issue with nginx-sso I recommend reading on HTTP Caching and Cache-Control / Expires headers.