?
Solved

Changing REMOTE_USER with a CGI rather than closing the browser

Posted on 1998-06-13
4
Medium Priority
?
292 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.
0
Comment
Question by:cjb061398
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
julio011597 earned 100 total points
ID: 1829779
Indeed, the web server does keep asking for name:passwd... it is the *intelligent* browser which sends them behind the scenes. Anyway, you can bypass this browser's automatic mechanisms by providing the pair as part of the location url.

Say the new pair is "cjb:mypwd", and the page to access is "http://my.host.com". Then you can force the new pair to be sent by putting this url into the location field:

http://cjb:mypwd@my.host.com

This is, in fact, the same mechanism you would use to access password protected ftp sites.

Regards, julio
0
 
LVL 6

Expert Comment

by:alamo
ID: 1829780
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.

0
 
LVL 5

Expert Comment

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

cjb, still around?

-julio
0
 
LVL 6

Expert Comment

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

0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question