pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Hammond <drew@waugh.econ.queensu.ca>
To: [PHP] PostgreSQL <pgsql-php@postgresql.org>
Subject: Re: the "correct" way to login.
Date: Thu, 29 Mar 2001 18:41:17 -0500
Message-ID: <20010329184117.A12756@waugh.econ.queensu.ca> (raw)
In-Reply-To: <006e01c0aec8$c90ae300$6501a8c0@genesis>
References: <01031319422609.24705@math.unl.edu.ar>
	<NEBBJIFEELNNHFCELNFJMEAACBAA.cm@chello.at>
	<20010315053738.A15125@waugh.econ.queensu.ca>
	<008301c0ad49$b9dd9ba0$4905a8c0@bh.embare.com.br>
	<002f01c0ad7e$2114cdf0$533987cf@corp.peoplesoft.com>
	<006e01c0aec8$c90ae300$6501a8c0@genesis>

On Sat, Mar 17, 2001 at 01:58:15AM -0800, Jon Tai wrote:

> HTTP auth is bad for several reasons.
> 
> 1)  The user/pass is submitted upon each request to the page.

As it is with the cookie solution you provide below.  Assuming you have
one, what's your point?

> 2)  There is no way to control how long a session lasts (auto-logout after a
> certain time)

That is incorrect.  Not only is this possible but it's relatively
trivial.  I know because I've done it.

> 3)  There is no way to end the session explicitly (logout button)

IBID.

And a much more severe problem is present with your form based login.
You may be shocked to hear this, but some web browsers have a history
feature which allows evil bad people to discover userid/password
combinations in URL's accessed by GET forms.  So of course you have to
POST the form instead.  The variables from POSTed forms are typically
cached so you'd better not forget to expire the content.  So you're good 
to go, except for that damned cookie file.  While you can easily set a
expiry date on a cookie, that doesn't necessarily purge it from the
cookie file.  In fact, some browsers only vacuum their cookie jar on
startup / shutdown.  And it doesn't take a whole lot of clue to dissect
a cookie file.

> 4)  There is built-in session support in PHP4.  Use it.  =)

There is built-in authorization support in the HTTP standard.  Use it.

Try reading "HTTP 1.1" RFC 2068 sections 10.4.2, 11 and 14.8.

So, I say again: the correct way to solve this problem is to use HTTP
authentication.  Standards exist for a reason.



view thread (5+ messages)

Message-ID: <20010329184117.A12756@waugh.econ.queensu.ca>
Permalink:  ../20010329184117.A12756@waugh.econ.queensu.ca/
Also on:    postgresql.org/message-id/20010329184117.A12756@waugh.econ.queensu.ca

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: drew@waugh.econ.queensu.ca
  Subject: Re: the "correct" way to login.
  In-Reply-To: <20010329184117.A12756@waugh.econ.queensu.ca>
  References: <01031319422609.24705@math.unl.edu.ar> <NEBBJIFEELNNHFCELNFJMEAACBAA.cm@chello.at> <20010315053738.A15125@waugh.econ.queensu.ca> <008301c0ad49$b9dd9ba0$4905a8c0@bh.embare.com.br> <002f01c0ad7e$2114cdf0$533987cf@corp.peoplesoft.com> <006e01c0aec8$c90ae300$6501a8c0@genesis> <20010329184117.A12756@waugh.econ.queensu.ca>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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