Re: newbie user authentication question

From: Date: Wed, 04 Oct 2000 19:40:53 +0000
Subject: Re: newbie user authentication question
Groups: php.general 
Request: Send a blank email to php-general+get-18647@lists.php.net to get a copy of this message
What I did is make a cookie when a user logs in and use the PHP_AUTH_USER and PHP_AUTH_PASS for the cookie. I made a script to check the values of the cookie and put it in an include file. I included the file in all the pages I wanted security. You can set the cookie to expire in a short amount of time to increase security. --- Rachel Daniell <rachel@mediajumpstart.org> wrote: > Does anyone have advice for me on user > authentication? > > To gain access to an area of a web site for certain > member organizations only, I have > created a script that authenticates user names and > passwords against a database that > using this type of code: > if (!isset($PHP_AUTH_USER)) { > header('WWW-Authenticate: Basic realm="Private"'); > header('HTTP/1.0 401 Unauthorized'); > exit; > } else if (isset($PHP_AUTH_USER)) { > > // check the user database for matching name & > password....(etc.) > > The authentication against the database is working > fine. > My only concern is, how do I make this work on > multiple pages? All of the tutorials > I've found so far only address a single point of > authentication, but I have several > pages in the private area of the site that a user > could theoretically bookmark and > return to without being prompted to log in. > Should I copy this code onto each page? > Or is there some simple IF ELSE statement I can make > on each page to check if they > have logged in already? > Or do I need to be doing this a different way > altogether (such as with sessions)....? > > If anyone has any advice for me, I'd love to hear > it. > cheers, > Rach > > ------------------------------------------- > Rachel Daniell > Media Jumpstart > a nonprofit technology resource for NYC nonprofits > rachel@mediajumpstart.org > 212-894-3386 > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: > php-general-unsubscribe@lists.php.net > For additional commands, e-mail: > php-general-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net > __________________________________________________ Do You Yahoo!? Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free! http://photos.yahoo.com/

« previous php.general (#18647) next »