Re: AUTH - verifying authentication on later pages
| From: | Justin Patrin | 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: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--- Adam Ashley <aashley@adamashley.name> wrote:manualOn 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 thenewbieonthis one - although you would consider it aamquestion. Once they login and have all the sessionsassigned, onpages where they required to have logged in, I$_SESSION['_authsession']['data']['variablename']simply manually checking to seeAUTHisset and what it's equal to. (I set this afterthehasdone it's session setting.) Is there a more secure way? What aboutcheckauth()? calling Auth::getAuth() or Auth::checkAuth() isonly tocorrect 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 loginsecondarycontinue an existing session set the 'allowLogin' option to false. Adam AshleyDo you have, or know of any, examples forpages where prior authentication is required whilenothaving 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 atthetop of secured pages to check if the user hadalreadyauthenticated using AUTH. If it does not existand Ihave to add a login function to every page, wherethereal value of using AUTH - I am probably missing something here due to mey lack of experience withthispackage.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)