I am creating a plugin. When user tries to visit a website, I want to validate the user and then redirect back to the original domain once validated. I tried to set a Header in the request to indicate the user is validated and then http.Redirect using status code 302. But when I receive the request after redirecting, the Header field is not there. How can I achieve this?
Just to clarify, you had your server send a response header to the client alongside the redirect, and the problem is that the client didn’t return that header on subsequent requests?
Yes. I don’t see the header I set when I receive the request after redirect.
Unless the header in question is
Cookie, I don’t believe any client would have cause to repeat a header back to the server after receiving it, unless it was programmed to do so.
loginsrv does that (https://github.com/tarent/loginsrv).
But the line looks like it is updating the response header, not the request header.