pg.ddx.io pgsql-php@postgresql.org mailing list archive
help / color / mirror / Atom feedHTTP authentication
14+ messages / 5 participants
[nested] [flat]
* HTTP authentication
@ 2001-04-26 16:45 Christian Marschalek <cm@chello.at>
2001-04-26 18:42 ` Re: HTTP authentication Adam Lang <aalang@rutgersinsurance.com>
0 siblings, 1 reply; 14+ messages in thread
From: Christian Marschalek @ 2001-04-26 16:45 UTC (permalink / raw)
To: pgsql-php
Hi all!
I've read about http authentication with PHP in the PHP manual.
Now I wonder how I can make a logout button in the way its supposed to be done? The manual mentions something about the headers but that this way does not work correct on all browsers...
Furthermore I wonder how secure this way is?
Tia
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: HTTP authentication
2001-04-26 16:45 HTTP authentication Christian Marschalek <cm@chello.at>
@ 2001-04-26 18:42 ` Adam Lang <aalang@rutgersinsurance.com>
0 siblings, 0 replies; 14+ messages in thread
From: Adam Lang @ 2001-04-26 18:42 UTC (permalink / raw)
To: pgsql-php
It matters. There are about a dozen ways to do authentication.
Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
http://www.rutgersinsurance.com
----- Original Message -----
From: "Christian Marschalek" <cm@chello.at>
To: <pgsql-php@postgresql.org>
Sent: Thursday, April 26, 2001 12:45 PM
Subject: [PHP] HTTP authentication
> Hi all!
>
> I've read about http authentication with PHP in the PHP manual.
>
> Now I wonder how I can make a logout button in the way its supposed to be
done? The manual mentions something about the headers but that this way does
not work correct on all browsers...
>
> Furthermore I wonder how secure this way is?
>
> Tia
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: HTTP authentication
@ 2001-04-26 19:09 Adam Lang <aalang@rutgersinsurance.com>
2001-04-27 15:43 ` RE: HTTP authentication Christian Marschalek <cm@chello.at>
0 siblings, 1 reply; 14+ messages in thread
From: Adam Lang @ 2001-04-26 19:09 UTC (permalink / raw)
To: pgsql-php
Are you doing authentication using sessions? Are you using timestamps in a
database? Are you using http-auth? etc.
There are several ways to do authentication and if you want to do a "logout"
button, the code would need to clear whatever is holding references to that
login... hence you need to say how you are doing authentication so you know
what needs to be cleaned up with a log out code.
Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
http://www.rutgersinsurance.com
----- Original Message -----
From: "Christian Marschalek" <cm@chello.at>
To: "'Adam Lang'" <aalang@rutgersinsurance.com>
Sent: Thursday, April 26, 2001 3:03 PM
Subject: RE: [PHP] HTTP authentication
> Can't see how this answers my questions :o)
>
> What matters?
>
> How would you do it?
>
> Thanks for your time, Chris
>
> > -----Original Message-----
> > From: pgsql-php-owner@postgresql.org
> > [mailto:pgsql-php-owner@postgresql.org] On Behalf Of Adam Lang
> > Sent: Thursday, April 26, 2001 8:42 PM
> > To: pgsql-php@postgresql.org
> > Subject: Re: [PHP] HTTP authentication
> >
> >
> > It matters. There are about a dozen ways to do authentication.
> >
> > Adam Lang
> > Systems Engineer
> > Rutgers Casualty Insurance Company http://www.rutgersinsurance.com
> > ----- Original Message -----
> > From: "Christian Marschalek" <cm@chello.at>
> > To: <pgsql-php@postgresql.org>
> > Sent: Thursday, April 26, 2001 12:45 PM
> > Subject: [PHP] HTTP authentication
> >
> >
> > > Hi all!
> > >
> > > I've read about http authentication with PHP in the PHP manual.
> > >
> > > Now I wonder how I can make a logout button in the way its
> > supposed to
> > > be
> > done? The manual mentions something about the headers but
> > that this way does not work correct on all browsers...
> > >
> > > Furthermore I wonder how secure this way is?
> > >
> > > Tia
> > >
> > >
> > > ---------------------------(end of
> > > broadcast)---------------------------
> > > TIP 2: you can get off all lists at once with the unregister command
> > > (send "unregister YourEmailAddressHere" to
> > majordomo@postgresql.org)
> >
> >
> > ---------------------------(end of
> > broadcast)---------------------------
> > TIP 4: Don't 'kill -9' the postmaster
> >
^ permalink raw reply [nested|flat] 14+ messages in thread
* RE: HTTP authentication
2001-04-26 19:09 Re: HTTP authentication Adam Lang <aalang@rutgersinsurance.com>
@ 2001-04-27 15:43 ` Christian Marschalek <cm@chello.at>
2001-04-27 16:31 ` Re: HTTP authentication Adam Lang <aalang@rutgersinsurance.com>
0 siblings, 1 reply; 14+ messages in thread
From: Christian Marschalek @ 2001-04-27 15:43 UTC (permalink / raw)
To: 'Adam Lang' <aalang@rutgersinsurance.com>; +Cc: pgsql-php
I guess simple HTTP authentication where I get the username and pass and
check it with the database... Maybe encrypting.
What would you recommend? I haven't done something like that before.
It's my first project which needs authentication!
Don't have a clue:)
> -----Original Message-----
> From: pgsql-php-owner@postgresql.org
> [mailto:pgsql-php-owner@postgresql.org] On Behalf Of Adam Lang
> Sent: Thursday, April 26, 2001 9:10 PM
> To: pgsql-php@postgresql.org
> Subject: Re: [PHP] HTTP authentication
>
>
> Are you doing authentication using sessions? Are you using
> timestamps in a database? Are you using http-auth? etc.
>
> There are several ways to do authentication and if you want
> to do a "logout" button, the code would need to clear
> whatever is holding references to that login... hence you
> need to say how you are doing authentication so you know what
> needs to be cleaned up with a log out code.
>
> Adam Lang
> Systems Engineer
> Rutgers Casualty Insurance Company http://www.rutgersinsurance.com
> ----- Original Message -----
> From: "Christian Marschalek" <cm@chello.at>
> To: "'Adam Lang'" <aalang@rutgersinsurance.com>
> Sent: Thursday, April 26, 2001 3:03 PM
> Subject: RE: [PHP] HTTP authentication
>
>
> > Can't see how this answers my questions :o)
> >
> > What matters?
> >
> > How would you do it?
> >
> > Thanks for your time, Chris
> >
> > > -----Original Message-----
> > > From: pgsql-php-owner@postgresql.org
> > > [mailto:pgsql-php-owner@postgresql.org] On Behalf Of Adam Lang
> > > Sent: Thursday, April 26, 2001 8:42 PM
> > > To: pgsql-php@postgresql.org
> > > Subject: Re: [PHP] HTTP authentication
> > >
> > >
> > > It matters. There are about a dozen ways to do authentication.
> > >
> > > Adam Lang
> > > Systems Engineer
> > > Rutgers Casualty Insurance Company http://www.rutgersinsurance.com
> > > ----- Original Message -----
> > > From: "Christian Marschalek" <cm@chello.at>
> > > To: <pgsql-php@postgresql.org>
> > > Sent: Thursday, April 26, 2001 12:45 PM
> > > Subject: [PHP] HTTP authentication
> > >
> > >
> > > > Hi all!
> > > >
> > > > I've read about http authentication with PHP in the PHP manual.
> > > >
> > > > Now I wonder how I can make a logout button in the way its
> > > supposed to
> > > > be
> > > done? The manual mentions something about the headers but
> that this
> > > way does not work correct on all browsers...
> > > >
> > > > Furthermore I wonder how secure this way is?
> > > >
> > > > Tia
> > > >
> > > >
> > > > ---------------------------(end of
> > > > broadcast)---------------------------
> > > > TIP 2: you can get off all lists at once with the
> unregister command
> > > > (send "unregister YourEmailAddressHere" to
> > > majordomo@postgresql.org)
> > >
> > >
> > > ---------------------------(end of
> > > broadcast)---------------------------
> > > TIP 4: Don't 'kill -9' the postmaster
> > >
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
http://www.postgresql.org/search.mpl
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: HTTP authentication
2001-04-26 19:09 Re: HTTP authentication Adam Lang <aalang@rutgersinsurance.com>
2001-04-27 15:43 ` RE: HTTP authentication Christian Marschalek <cm@chello.at>
@ 2001-04-27 16:31 ` Adam Lang <aalang@rutgersinsurance.com>
0 siblings, 0 replies; 14+ messages in thread
From: Adam Lang @ 2001-04-27 16:31 UTC (permalink / raw)
To: ; +Cc: pgsql-php
The way i do it is have a separate table in the database that keeps track of
users and passwords for the application.
I use the WWW-Authenticate header to get $PHP_AUTH_USER and $PHP_AUTH_PW
I run them through the table using a select query. If I come back with a
match, I set a variable, $auth, equal to true.
If $auth is equal to true, they can perform whatever functions in the page I
have.
I don't have a log out button, but all I would probably do would be set
$auth = false and unset the $PHP... variables.
Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
http://www.rutgersinsurance.com
----- Original Message -----
From: "Christian Marschalek" <cm@chello.at>
To: "'Adam Lang'" <aalang@rutgersinsurance.com>
Cc: "[PHP] PostgreSQL" <pgsql-php@postgresql.org>
Sent: Friday, April 27, 2001 11:43 AM
Subject: RE: [PHP] HTTP authentication
> I guess simple HTTP authentication where I get the username and pass and
> check it with the database... Maybe encrypting.
>
> What would you recommend? I haven't done something like that before.
> It's my first project which needs authentication!
>
> Don't have a clue:)
>
> > -----Original Message-----
> > From: pgsql-php-owner@postgresql.org
> > [mailto:pgsql-php-owner@postgresql.org] On Behalf Of Adam Lang
> > Sent: Thursday, April 26, 2001 9:10 PM
> > To: pgsql-php@postgresql.org
> > Subject: Re: [PHP] HTTP authentication
> >
> >
> > Are you doing authentication using sessions? Are you using
> > timestamps in a database? Are you using http-auth? etc.
> >
> > There are several ways to do authentication and if you want
> > to do a "logout" button, the code would need to clear
> > whatever is holding references to that login... hence you
> > need to say how you are doing authentication so you know what
> > needs to be cleaned up with a log out code.
> >
> > Adam Lang
> > Systems Engineer
> > Rutgers Casualty Insurance Company http://www.rutgersinsurance.com
> > ----- Original Message -----
> > From: "Christian Marschalek" <cm@chello.at>
> > To: "'Adam Lang'" <aalang@rutgersinsurance.com>
> > Sent: Thursday, April 26, 2001 3:03 PM
> > Subject: RE: [PHP] HTTP authentication
> >
> >
> > > Can't see how this answers my questions :o)
> > >
> > > What matters?
> > >
> > > How would you do it?
> > >
> > > Thanks for your time, Chris
> > >
> > > > -----Original Message-----
> > > > From: pgsql-php-owner@postgresql.org
> > > > [mailto:pgsql-php-owner@postgresql.org] On Behalf Of Adam Lang
> > > > Sent: Thursday, April 26, 2001 8:42 PM
> > > > To: pgsql-php@postgresql.org
> > > > Subject: Re: [PHP] HTTP authentication
> > > >
> > > >
> > > > It matters. There are about a dozen ways to do authentication.
> > > >
> > > > Adam Lang
> > > > Systems Engineer
> > > > Rutgers Casualty Insurance Company http://www.rutgersinsurance.com
> > > > ----- Original Message -----
> > > > From: "Christian Marschalek" <cm@chello.at>
> > > > To: <pgsql-php@postgresql.org>
> > > > Sent: Thursday, April 26, 2001 12:45 PM
> > > > Subject: [PHP] HTTP authentication
> > > >
> > > >
> > > > > Hi all!
> > > > >
> > > > > I've read about http authentication with PHP in the PHP manual.
> > > > >
> > > > > Now I wonder how I can make a logout button in the way its
> > > > supposed to
> > > > > be
> > > > done? The manual mentions something about the headers but
> > that this
> > > > way does not work correct on all browsers...
> > > > >
> > > > > Furthermore I wonder how secure this way is?
> > > > >
> > > > > Tia
> > > > >
> > > > >
> > > > > ---------------------------(end of
> > > > > broadcast)---------------------------
> > > > > TIP 2: you can get off all lists at once with the
> > unregister command
> > > > > (send "unregister YourEmailAddressHere" to
> > > > majordomo@postgresql.org)
> > > >
> > > >
> > > > ---------------------------(end of
> > > > broadcast)---------------------------
> > > > TIP 4: Don't 'kill -9' the postmaster
> > > >
> >
> >
> > ---------------------------(end of
> > broadcast)---------------------------
> > TIP 6: Have you searched our list archives?
> >
> http://www.postgresql.org/search.mpl
^ permalink raw reply [nested|flat] 14+ messages in thread
* RE: HTTP authentication
@ 2001-04-27 18:45 Jason k Larson <jlarson@harrison.org>
0 siblings, 0 replies; 14+ messages in thread
From: Jason k Larson @ 2001-04-27 18:45 UTC (permalink / raw)
To: pgsql-php
I have written a library to handle this. It is fairly secure
not allowing the password to be seen except as an MD5 digest. The
only requirement is being able to deal with the MD5 digest. For
instance I have a PgSQL Table with fields User ID, Username, Password,
and Status. I give each User and unique ID and the Password field
contains and MD5 digest of the password and I use status (boolean) to
tell me if the user is active or not.
If you are interested I could send you my library .. it's pretty
basic.
Jason k Larson
Web Developer++
CM> I guess simple HTTP authentication where I get the username and pass and
CM> check it with the database... Maybe encrypting.
CM> What would you recommend? I haven't done something like that before.
CM> It's my first project which needs authentication!
CM> Don't have a clue:)
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: HTTP authentication
@ 2001-04-27 18:46 Jason k Larson <jlarson@harrison.org>
2001-04-27 19:26 ` Re: HTTP authentication Adam Lang <aalang@rutgersinsurance.com>
0 siblings, 1 reply; 14+ messages in thread
From: Jason k Larson @ 2001-04-27 18:46 UTC (permalink / raw)
To: pgsql-php
This is all good but needs to be dealing with the password as a
hash/digest not the real clear text password. I would use SHA1
(SHA-160) or MD5.
Jason k Larson
Web Developer++
AL> The way i do it is have a separate table in the database that keeps track of
AL> users and passwords for the application.
AL> I use the WWW-Authenticate header to get $PHP_AUTH_USER and $PHP_AUTH_PW
AL> I run them through the table using a select query. If I come back with a
AL> match, I set a variable, $auth, equal to true.
AL> If $auth is equal to true, they can perform whatever functions in the page I
AL> have.
AL> I don't have a log out button, but all I would probably do would be set
AL> $auth = false and unset the $PHP... variables.
AL> Adam Lang
AL> Systems Engineer
AL> Rutgers Casualty Insurance Company
AL> http://www.rutgersinsurance.com
AL> ----- Original Message -----
AL> From: "Christian Marschalek" <cm@chello.at>
AL> To: "'Adam Lang'" <aalang@rutgersinsurance.com>
AL> Cc: "[PHP] PostgreSQL" <pgsql-php@postgresql.org>
AL> Sent: Friday, April 27, 2001 11:43 AM
AL> Subject: RE: [PHP] HTTP authentication
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: HTTP authentication
2001-04-27 18:46 Re: HTTP authentication Jason k Larson <jlarson@harrison.org>
@ 2001-04-27 19:26 ` Adam Lang <aalang@rutgersinsurance.com>
2001-04-27 21:00 ` RE: HTTP authentication Christian Marschalek <cm@chello.at>
0 siblings, 1 reply; 14+ messages in thread
From: Adam Lang @ 2001-04-27 19:26 UTC (permalink / raw)
To: pgsql-php
You are correct. I was keeping it simple since his original question was
merely on the "logout" button.
Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
http://www.rutgersinsurance.com
----- Original Message -----
From: "Jason k Larson" <jlarson@harrison.org>
To: "PgSQL-PHP" <pgsql-php@postgresql.org>
Sent: Friday, April 27, 2001 2:46 PM
Subject: Re: [PHP] HTTP authentication
> This is all good but needs to be dealing with the password as a
> hash/digest not the real clear text password. I would use SHA1
> (SHA-160) or MD5.
>
> Jason k Larson
> Web Developer++
>
>
> AL> The way i do it is have a separate table in the database that keeps
track of
> AL> users and passwords for the application.
>
> AL> I use the WWW-Authenticate header to get $PHP_AUTH_USER and
$PHP_AUTH_PW
>
> AL> I run them through the table using a select query. If I come back
with a
> AL> match, I set a variable, $auth, equal to true.
>
> AL> If $auth is equal to true, they can perform whatever functions in the
page I
> AL> have.
>
> AL> I don't have a log out button, but all I would probably do would be
set
> AL> $auth = false and unset the $PHP... variables.
>
> AL> Adam Lang
> AL> Systems Engineer
> AL> Rutgers Casualty Insurance Company
> AL> http://www.rutgersinsurance.com
> AL> ----- Original Message -----
> AL> From: "Christian Marschalek" <cm@chello.at>
> AL> To: "'Adam Lang'" <aalang@rutgersinsurance.com>
> AL> Cc: "[PHP] PostgreSQL" <pgsql-php@postgresql.org>
> AL> Sent: Friday, April 27, 2001 11:43 AM
> AL> Subject: RE: [PHP] HTTP authentication
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
^ permalink raw reply [nested|flat] 14+ messages in thread
* RE: HTTP authentication
2001-04-27 18:46 Re: HTTP authentication Jason k Larson <jlarson@harrison.org>
2001-04-27 19:26 ` Re: HTTP authentication Adam Lang <aalang@rutgersinsurance.com>
@ 2001-04-27 21:00 ` Christian Marschalek <cm@chello.at>
0 siblings, 0 replies; 14+ messages in thread
From: Christian Marschalek @ 2001-04-27 21:00 UTC (permalink / raw)
To: 'Adam Lang' <aalang@rutgersinsurance.com>; +Cc: pgsql-php
> You are correct. I was keeping it simple since his original
> question was merely on the "logout" button.
Well I want to learn the most I can :o)
The problem with the logout and the HTTP stuff is that the browser keeps
the auth. Information in the cache, so you'll need a way to tell the
browser to reask the user for his login data.
^ permalink raw reply [nested|flat] 14+ messages in thread
* RE: HTTP authentication
@ 2001-04-27 20:54 Christian Marschalek <cm@chello.at>
2001-04-28 15:17 ` Re: HTTP authentication Roberto Mello <rmello@cc.usu.edu>
0 siblings, 1 reply; 14+ messages in thread
From: Christian Marschalek @ 2001-04-27 20:54 UTC (permalink / raw)
To: 'Andrew Hammond' <drew@waugh.econ.queensu.ca>; +Cc: pgsql-php
> -----Original Message-----
> From: Andrew Hammond [mailto:drew@waugh.econ.queensu.ca]
> Sent: Friday, April 27, 2001 8:21 PM
> To: Christian Marschalek
> Subject: Re: [PHP] HTTP authentication
>
> If you need _serious_ security, then you need to start
> thinking about using SSL and x.509 certificates.
I don't think the project needs to be THAT secure. But anyway, the SSL
stuff only secures my connection. I'd still need a way to control access
to my system, wouldn't I?
> Otherwise, you can reasonably use
> either the http auth stuff, which is probably the best approach,
> especially for a site that's got any kind of heavy usage or
> something based on PHP sessions. However be forewarned that
> the sessions stuff isn't exactly the most efficient and fast.
(either?:)
Well PHP auth and sessions is probably the right aproach. Which one
would be more efficient or faster?
Thanks and greetings Chris
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: HTTP authentication
2001-04-27 20:54 RE: HTTP authentication Christian Marschalek <cm@chello.at>
@ 2001-04-28 15:17 ` Roberto Mello <rmello@cc.usu.edu>
2001-04-28 17:44 ` RE: HTTP authentication Christian Marschalek <cm@chello.at>
0 siblings, 1 reply; 14+ messages in thread
From: Roberto Mello @ 2001-04-28 15:17 UTC (permalink / raw)
To: Christian Marschalek <cm@chello.at>; +Cc: 'Andrew Hammond' <drew@waugh.econ.queensu.ca>; pgsql-php
On Fri, Apr 27, 2001 at 10:54:21PM +0200, Christian Marschalek wrote:
> > Otherwise, you can reasonably use
> > either the http auth stuff, which is probably the best approach,
> > especially for a site that's got any kind of heavy usage or
> > something based on PHP sessions. However be forewarned that
> > the sessions stuff isn't exactly the most efficient and fast.
What's the problem with sessions? Are they slow? I don't see why since
it just grabs the cookie from the browser and reads the appropriate file
from the sessions directory.
> Well PHP auth and sessions is probably the right aproach. Which one
> would be more efficient or faster?
I just wrote an auth library that uses sessions and stores passwords
encrypted in the database. I am fairly new to PHP (tho experienced in
other web devel technologies) so it might need improvements, but it works
very well for me.
-Roberto
--
+----| http://fslc.usu.edu USU Free Software & GNU/Linux Club |------+
Roberto Mello - Computer Science, USU - http://www.brasileiro.net
http://www.sdl.usu.edu - Space Dynamics Lab, Developer
let length(Long_Walk) > length(Short_Pier)
^ permalink raw reply [nested|flat] 14+ messages in thread
* RE: HTTP authentication
2001-04-27 20:54 RE: HTTP authentication Christian Marschalek <cm@chello.at>
2001-04-28 15:17 ` Re: HTTP authentication Roberto Mello <rmello@cc.usu.edu>
@ 2001-04-28 17:44 ` Christian Marschalek <cm@chello.at>
2001-04-28 23:20 ` Re: HTTP authentication Roberto Mello <rmello@cc.usu.edu>
2001-11-16 10:26 ` Re: HTTP authentication Andrew McMillan <andrew@catalyst.net.nz>
0 siblings, 2 replies; 14+ messages in thread
From: Christian Marschalek @ 2001-04-28 17:44 UTC (permalink / raw)
To: 'Roberto Mello' <rmello@cc.usu.edu>; +Cc: pgsql-php
> I just wrote an auth library that uses sessions and
> stores passwords encrypted in the database. I am fairly new
> to PHP (tho experienced in other web devel technologies) so
> it might need improvements, but it works very well for me.
I'm fairly new to PHP myself but I have like 4 years expirience with C
and C++. I would check out if your library can be improved if you want
me to.
But for my project I'll use sessions without cookies because I can't
rely on the users having the feature turned on in their browsers.
Greets
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: HTTP authentication
2001-04-27 20:54 RE: HTTP authentication Christian Marschalek <cm@chello.at>
2001-04-28 15:17 ` Re: HTTP authentication Roberto Mello <rmello@cc.usu.edu>
2001-04-28 17:44 ` RE: HTTP authentication Christian Marschalek <cm@chello.at>
@ 2001-04-28 23:20 ` Roberto Mello <rmello@cc.usu.edu>
1 sibling, 0 replies; 14+ messages in thread
From: Roberto Mello @ 2001-04-28 23:20 UTC (permalink / raw)
To: Christian Marschalek <cm@chello.at>; +Cc: pgsql-php
On Sat, Apr 28, 2001 at 07:44:43PM +0200, Christian Marschalek wrote:
>
> I'm fairly new to PHP myself but I have like 4 years expirience with C
> and C++. I would check out if your library can be improved if you want
> me to.
>
> But for my project I'll use sessions without cookies because I can't
> rely on the users having the feature turned on in their browsers.
My library should be ok with cookies turned off since it's managed
through PHP4 sessions, which can use server-side or client-side cookies.
Let me finish my finals (next week) and refine it a little bit, then
I'll post it somewhere on my website and let the list know.
I also made yet another DB abstraction layer for PHP, modeled after
AOLserver's excellent DB layer. I was using PEAR bet everytime I accessed
a page using PEAR I had time to go buy a pizza and come back before the
query was done, so I decided to write my own.
-Roberto
--
+----| http://fslc.usu.edu USU Free Software & GNU/Linux Club |------+
Roberto Mello - Computer Science, USU - http://www.brasileiro.net
http://www.sdl.usu.edu - Space Dynamics Lab, Developer
A little inaccuracy sometimes saves tons of explanation. -- H. H. Munroe
^ permalink raw reply [nested|flat] 14+ messages in thread
* Re: HTTP authentication
2001-04-27 20:54 RE: HTTP authentication Christian Marschalek <cm@chello.at>
2001-04-28 15:17 ` Re: HTTP authentication Roberto Mello <rmello@cc.usu.edu>
2001-04-28 17:44 ` RE: HTTP authentication Christian Marschalek <cm@chello.at>
@ 2001-11-16 10:26 ` Andrew McMillan <andrew@catalyst.net.nz>
1 sibling, 0 replies; 14+ messages in thread
From: Andrew McMillan @ 2001-11-16 10:26 UTC (permalink / raw)
To: Christian Marschalek <cm@chello.at>; +Cc: pgsql-php
On Sun, 2001-04-29 at 05:44, Christian Marschalek wrote:
> > I just wrote an auth library that uses sessions and
> > stores passwords encrypted in the database. I am fairly new
> > to PHP (tho experienced in other web devel technologies) so
> > it might need improvements, but it works very well for me.
>
> I'm fairly new to PHP myself but I have like 4 years expirience with C
> and C++. I would check out if your library can be improved if you want
> me to.
>
> But for my project I'll use sessions without cookies because I can't
> rely on the users having the feature turned on in their browsers.
Don't forget that there are serious flaws in the URL rewriting approach
as well which are not present in the cookie approach :-(
Our company recently implemented a site where one of the more
egotistical coders was militantly anti-cookie and as a result we ended
up with URL rewriting (auth was not an option in this case).
As a result we ended up with people e-mailing (rewritten) URL's to
friends, or pasted (rewritten) URL's into ad serversand so forth. A few
days after we went live we had one session that was receiving a
substantial part of the traffic, and that session was saving user data
which was mutating in interesting ways.
On top of that, we finally ended up implementing cookies because it
turned out we needed more persistence of data than URL rewriting can
offer. The session code is _still_ crapola IMNSHO because it uses the
rewriting by preference, rather than treating the cookie as 'best'.
The PHP session code gets this _right_ by preferring cookies and falling
back to URL rewriting _if_it_has_to_ for those reasons.
Sure, cookies are some sort of security problem, but so are bookmarks
and history, not to mention page caches! If you wouldn't put it in a
URL, then don't put it in a cookie, by all means, but it is debatable
(and configurable) which hangs around on a users hard disk for the
longest. I know my browser history (i.e. URL coded information) is
currently set for three months, but if I get a session cookie it is gone
when I close my browser down - something I usually have to do every few
days.
All that I put in a cookie is an encrypted hashed value. Everything
else is derivable at the server end. I also only ever set one cookie,
and associate all information with that, again at the server.
Regards,
Andrew.
--
--------------------------------------------------------------------
Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington
WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St
DDI: +64(4)916-7201 MOB: +64(21)635-694 OFFICE: +64(4)499-2267
^ permalink raw reply [nested|flat] 14+ messages in thread
end of thread, other threads:[~2001-11-16 10:26 UTC | newest]
Thread overview: 14+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-04-26 16:45 HTTP authentication Christian Marschalek <cm@chello.at>
2001-04-26 18:42 ` Adam Lang <aalang@rutgersinsurance.com>
2001-04-26 19:09 Re: HTTP authentication Adam Lang <aalang@rutgersinsurance.com>
2001-04-27 15:43 ` Christian Marschalek <cm@chello.at>
2001-04-27 16:31 ` Adam Lang <aalang@rutgersinsurance.com>
2001-04-27 18:45 RE: HTTP authentication Jason k Larson <jlarson@harrison.org>
2001-04-27 18:46 Re: HTTP authentication Jason k Larson <jlarson@harrison.org>
2001-04-27 19:26 ` Adam Lang <aalang@rutgersinsurance.com>
2001-04-27 21:00 ` Christian Marschalek <cm@chello.at>
2001-04-27 20:54 RE: HTTP authentication Christian Marschalek <cm@chello.at>
2001-04-28 15:17 ` Roberto Mello <rmello@cc.usu.edu>
2001-04-28 17:44 ` Christian Marschalek <cm@chello.at>
2001-04-28 23:20 ` Roberto Mello <rmello@cc.usu.edu>
2001-11-16 10:26 ` Andrew McMillan <andrew@catalyst.net.nz>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox