I have set up a nginx server with cgi on Linux. A specific program is used to end a user's session (logout) and to redirect the user to another page, but first the mentioned program processes some data (cookies) and answers the browser with different cookies.
This program is called whenever a user clicks on the logout-button.
HTTP-Request-Header:
Cookie: EMAIL=test@dummy; SID=1234
The program changes a database-entry and then returns:
HTTP-Response-Header:
Set-Cookie: EMAIL=NULL; SID=0
Status: 301 Location: https://<myIP>/index.html
The described procedure works if the user's browser-cache is empty. --> The user has accessed the page for the first time after browser-startupt.
The log files /var/log/nginx/error.log
and /var/log/nginx/access.log
show the expected reactions and contents.
When a user logs in again and clicks on the logout-button, the program is not executed at all.
Only after clearing the history, cache and cookies of the user's browser the logout-procedure works as it should.
I already tried Cache-Control: no-cache
as a HTTP-Response-Header-Field with no effect.
What is necessary to make the program execute every time the user clicks on the logout-button?