Thanks again Gert for your suggestions and observations.  I did notice
something interesting on the last suggestion with regards to sending it back
to apache. I did not want to send it back as a query string but as a cookie.
However when I used my script to obtain the user name on the user's computer
and then build a client-side web page that they could click on and set the
cookie, I found that I could not make it create with the domain that I gave
to the cookie creation side of the script. I had to leave the domain parm
out of the cookie creation.  This resulted in a cookie that was built with
the name [EMAIL PROTECTED]  or whatever directory on the C drive the script
was run from. 

Just an observation, I finally got those that requested the project to agree
with a one shot logon cgi that checks the user name and password against our
internal db and then sets a one time cookie that gets checked again.

-----Original Message-----
From: Gert Lombard [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 26, 2002 2:27 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Any help appreciated - unusual cookie request


Or: like any other site: why not just have a login page in HTML that prompts
the user for his UserName (and even password if you like).

Alternatively, if you insist on getting the OS UserName, and if you have so
much control over the user's machines that you could have used a logon
script, then:

Give each user a simple loader program (e.g. deploy from logon script and
put shortcut on Desktop) that brings up IE with the correct URL while
passing the UserName as a query string parameter...  It could even be as
simple as a batch file with a single line like:
start http://mysite/index.pl?user=%USERNAME%

Or: Why not just make a simple client-side ActiveX control with ATL or VB
that gets the user's UserName. Use client-side JavaScript to do the work.

Then, you can choose whichever method you like to send the UserName back to
Apache.  E.g. you could still send it back as a cookie, or hidden form
element, or querystring parameter etc.

E.g:

<input type="hidden" name="HiddenElement">

<object id="MyObj" classid="CLSID:11223344-5566-7777-8888-99AABBCCDDEE"
codebase="MyObj.dll#Version=1,0,0,1"></object>

<script language="JavaScript>
function onLoad() {
  Form1.HiddenElement.value = MyObj.GetUserName();
}
</script>

Good luck,
-Gert

> -----Original Message-----
> From: $Bill Luebkert [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 26, 2002 2:05 PM
> To: Norris, Joseph
> Cc: Perl Web (E-mail)
> Subject: Re: Any help appreciated - unusual cookie request
> 
> 
> Norris, Joseph wrote:
> > Here is the situation: I am on an network of windows boxes 
> with apache
> > running on one of the boxes. I have my web apps there with 
> perl/mysql etc..
> > I want to build a script that will be run in the users 
> login script that
> > will take the username via $ENV{USERNAME} and build a 
> cookie do a request to
> > the server so that the cookie will be built on the users 
> box containing the
> > user's USERNAME, so that I can use cgi->cookie and know who 
> is there. What I
> > have attempted so far. I have a cookie built on the opening 
> page of my
> > intranet site. The cookie contains a bogus value. In the 
> login script I had
> > a script that runs out and finds the cookie file no matter 
> where it is on
> > the user's disk, slurps it and writes it back out with the 
> $ENV{USERNAME}. I
> > use all the same delimiters for records etc and the file 
> looks exactly the
> > same (or so I think) as the original cookie file. However 
> the browser spots
> > the different fast - won't access the cookie and then 
> trashes even when I
> > set expire to 01/01/2045. Any and all observations appreciated. 
> 
> I would just use HTTP basic authentication - they only have 
> to login once
> and they can have their browser remember the login if they 
> wish (for later
> instantiations of the browser).
> 
> -- 
>    ,-/-  __      _  _         $Bill Luebkert   ICQ=162126130
>   (_/   /  )    // //       DBE Collectibles   Mailto:[EMAIL PROTECTED]
>    / ) /--<  o // //      http://dbecoll.tripod.com/ (Free 
> site for Perl)
> -/-' /___/_<_</_</_     Castle of Medieval Myth & Magic 
http://www.todbe.com/

_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to