Link to home
Start Free TrialLog in
Avatar of StevenMiles
StevenMiles

asked on

How to track a specific user after basic authentication

I have successfully implemented basic authentication with apache on a site: the user needs to enter username and password on that horrible browser pop-up box, and then he has access to the restriced areas so he can read restricted material.  Works fine.  But now I'm working on a site where, when the user gains access, the CGI programs (perl) need to know *which* user is there, so, for example, he can see *his* account information or *his* customized pages.  I can't figure out how the perl programs identify the specific user upon his entry into the restricted area, and then keep track of which user it is as he navigates pages in the restricted section.

I can figure out some workarounds, like receiving and then passing back user name in a hidden form field on every page that the user sees in the restricted area, but I'm looking for a more straightforward solution that I hope exists.

Question that is possibly answered as part of a solution: is there any way to allow the user to gain access with UserName and Password fields on the page that I create, rather than that little browser popup box?
Thanks.
--Steve D.
SOLUTION
Avatar of m1tk4
m1tk4
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
m1tk4,

not to reproduce your solution.  it's just taking me almost 20 minutes to type it.  :)

cheers.
it's all good samri, I am not a big Perl buff myself so it would have taken me a lot more than 20 minutes to figure out how to read env vars from Perl;)
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial