Re: AUTH - verifying authentication on later pages

From: Date: Fri, 02 Feb 2007 18:37:18 +0000
Subject: Re: AUTH - verifying authentication on later pages
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-26482@lists.php.net to get a copy of this message
On 2/2/07, l Burnerheimerton <lburnerheimerton@yahoo.com> wrote:
--- Justin Patrin <papercrane@gmail.com> wrote: On 2/2/07, l Burnerheimerton <lburnerheimerton@yahoo.com> wrote:
--- Adam Ashley <aashley@adamashley.name> wrote:
On Thu, 1 Feb 2007 14:13:21 -0800 (PST), l Burnerheimerton <lburnerheimerton@yahoo.com> wrote:
It's been a while since I used AUTH and I have searched the pages and don't quite get the
manual
on
this one - although you would consider it a
newbie
question. Once they login and have all the sessions
assigned, on
pages where they required to have logged in, I
am
simply manually checking to see
$_SESSION['_authsession']['data']['variablename']
is
set and what it's equal to. (I set this after
AUTH
has
done it's session setting.) Is there a more secure way? What about
checkauth()? calling Auth::getAuth() or Auth::checkAuth() is
the
correct way to do it. If you don't then things like expiring, idle checking and session interception arent handled properly. If you don't want a page to be able to login
only to
continue an existing session set the 'allowLogin' option to false. Adam Ashley
Do you have, or know of any, examples for
secondary
pages where prior authentication is required while
not
having to put a login function on every page? What I am looking for, and I thought it existed already, was a quick two lines of code to put at
the
top of secured pages to check if the user had
already
authenticated using AUTH. If it does not exist
and I
have to add a login function to every page, where
the
real value of using AUTH - I am probably missing something here due to mey lack of experience with
this
package.
getAuth() checkAuth() Justin Patrin Justin - I appreciate you reply trying to answer my question. I have looked at the documentation, have found no examples or tutorials for what should be a common and frequently asked questions - "How to secure suceeding pages once someone has authenticated using AUTH?" I assumed it has something to do with getAuth() or checkAuth(). My specific question is do you have to redfine a new AUTH with all the options for each page or can you simply have some two-line code call that checks? You can't use checkAuth() without defining $a. You can't define $a without creating a new AUTH with all the options, that I can tell at least. That's a lot of extra code for every secured page. The way I test now is simply test for the existance and value of $_SESSION[_athsession][data][variable_name]. That is much easier and concise than redefining AUTH, $a, then calling an AUTH method. I hope I am missing something here, I really do. Please help me learn where I am going wrong?! ( and I am NOT being sarcastic)
Yes, you of course need to create an Auth object. Otherwise, how can Auth do its work? You should move your auth creation code into an include so that you don't have to reproduce it. -- Justin Patrin

« previous php.pear.general (#26482) next »