| |||||||||||
| |||||||||||
Identifying a web site visitor Posted by enquirer (enquirer), 21 November 2003 I am having great difficulty trying to get the username of a user currently logged in, using perl CGI in netscape. I tried using$ruser = "$ENV{'REMOTE_USER'}" but this doesn't work. I know it's possible, because I've seen other pages here that can extract the information. Actually - I copied the above line from one of them... but it still doesn't work in my program ![]() Can you help? Posted by admin (Graham Ellis), 21 November 2003 The web is DESIGNED to make this difficult ![]() Although there's a REMOTE_USER field in the environment, it only works on internal networks (intranets) where the identd daemon is running on the client's computer, which is pretty rare. It may work within your place of work, but if you're writing general pages on the internet it will be VERY rare for you to get a user name. Why isn't the user name more easily available? Because if I could get your user name when you visit my web site, I could then add you to my mailing list and send you spam. And so you would be put off visiting any new web sites. Thus the CGI interface is designed to give web site owners excellent marketing information (to tell them about their visitors without identifying them) but no sales information (to prevent them making up mailing lists). If you want / need to identify a user, you could get them to log in to your website and then set and use a cookie. If you're looking to run your code on your internal network, you could also try fingering the visiting host and finding out who's logged on ... do most machines run finger? Just some further thoughts ... no easy solution. As an educated guess, the program you've copied from runs internally with one group of users and the program you're writing is with an different group or even external. This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
|
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |