Search code examples
phphttpauthenticationhttp-redirecthttp-authentication

Php redirect with http authentication


How to redirect to a url and pass through in php the login and password http, ie, the http basic login but without user interference? without login pop-ups !

thanks, celso


Solution

  • Short answer is that you can't.

    Redirecting to http://user:pass@example.com/ will work on some browsers but not all.

    You could use a substitute authentication module, and push a value into it - e.g. using mod_authmemcookie on Apache if you're happy to tweak the server config like this (and have a cookie you can use).