If you are using sessions for authentication, I would recommend revalidating
the session's login information on each request (i.e., put the username &
password submitted into the session and check it each time) for two reasons:
1) If, for some reason, a page fails to call session_start(), a user can
populate the $_SESSION array from a query.
- and -
2) Let's say you delete a user from wherever you're storing user data
(database, file, etc.) If you validate on every request, they next time
s/he tries to do something, they will be stopped. If you trust a permission
variable stored in their session, they can continue doing whatever they want
until their session expires.
So I would instead put the "username" and "password" submitted into the
session and check it every time. Alternately use PHP with HTTP
authentication:
http://us2.php.net/manual/en/features.http-auth.php
- Kevin
"WindAndWaves" <access@ngaru.com> wrote in message
news:IzrKd.12586$mo2.972056@news.xtra.co.nz...[color=blue]
>
> "Kevin" <kevin@wxREMOVE4SPAM3.com> wrote in message
> news:z86dnelMReQwpmfcRVn-hw@comcast.com...[color=green]
>> Don't do it this way. If register globals is turned on, visitors can
>> simply
>> go to one of your "password protected" pages, add "?permission=1" to the
>> URI
>> and they will be allowed in.
>>
>>[/color]
>
> True Kevin - is there a way of preventing this from happening? Could I
> say something like if session("permission) < 1 then lockout?
>
>
>[/color]