We help IT Professionals succeed at work.

Changing REMOTE_USER with a CGI rather than closing the browser

cjb061398
cjb061398 asked
on
Medium Priority
332 Views
Last Modified: 2013-12-25
If I've already authenticated at a website with a username:password pair, how do I write a CGI that, when invoked, will reset the value of $REMOTE_USER, and challenge me again for my username:password pair. I want to be able to log in as a different user at this point.

I know I can close my browser and $REMOTE_USER will reset, but I'd like to avoid that pain.
Comment
Watch Question

Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Commented:
In many cases a better way might be "http://cjb@my.host.com" instead, leaving out the password. The dialog will pop up and ask you.

The advantage of this is that this way your password won't be included in your browser history or any bookmarks you make. I am not sure if your password shows up in the REFERER field also, when you click on an external link, it might, I've never checked.

Yes, right. About REFERER, i'm not sure either, but shouldn't be the case... anyway, to be tried.

cjb, still around?

-julio

Commented:
I just checked, name:pw@ does indeed show up in the REFERER. I tested with Netscape 4.04. So be careful...

Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.